Osclass Support Forums

Osclass theme support => Gamma Osclass Theme => Topic started by: Smithtech on December 25, 2020, 03:50:31 AM

Title: "Users can disable / de-activate listing" NOT working in Gamma
Post by: Smithtech on December 25, 2020, 03:50:31 AM
I have enabled Users can disable / de-activate listing but users do not see the option to disable their listings. Only Remove and Edit that they see.
Can you please help solve this?
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: MB Themes on December 25, 2020, 01:54:34 PM
@support
Make sure to update user-items.php based on what you have in sigma theme.
As this feature to disable listings is new, most themes does not have implemented this option.
If you open user-items.php or loop-single.php (loop-single-premium.php), you will find code similar to this one:
Code: [Select]
            <?php if(osc_item_is_inactive()) {?>
              <a href="<?php echo osc_item_activate_url();?>" ><?php _e('Activate''sigma'); ?></a>
            <?php ?>

You must add there also following code bellow:
Code: [Select]
            <?php if(osc_item_is_active() && osc_can_deactivate_items()) {?>
              <a href="<?php echo osc_item_deactivate_url();?>" ><?php _e('Deactivate''sigma'); ?></a>
            <?php ?>

To allow renewal of expired listings, you must also add this code:
Code: [Select]
            <?php if(osc_item_can_renew()) { ?>
              <a href="<?php echo osc_item_renew_url();?>" ><?php _e('Renew''sigma'); ?></a>
            <?php ?>

So integration into themes is quite simple  8)
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: Smithtech on December 25, 2020, 11:44:36 PM
Thank you very much.
I'm not sure I understand your instructions very well.
I'm using Gamma theme. I tried the code below in Gamma

<?php if(osc_item_is_active() && osc_can_deactivate_items()) {?>
              <a href="<?php echo osc_item_deactivate_url();?>" ><?php _e('Deactivate', 'gamma'); ?></a>
            <?php } ?>
When I "Deactivate" is clicked, it returns 404 error. Page not found.
And also, the Renew button is not showing.

Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: MB Themes on December 26, 2020, 01:07:07 PM
@support
Go to permalinks setting and properly update slugs for deactivate and renewal options. It may seems to be OK, but sometimes it is required to "refresh" this option.
Renewal is shown just for expired listings.
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: Smithtech on January 05, 2021, 11:59:05 AM
Thank you. It worked fine.
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: omadmin on January 27, 2021, 04:13:07 PM
@support
Make sure to update user-items.php based on what you have in sigma theme.
As this feature to disable listings is new, most themes does not have implemented this option.
If you open user-items.php or loop-single.php (loop-single-premium.php), you will find code similar to this one:
Code: [Select]
            <?php if(osc_item_is_inactive()) {?>
              <a href="<?php echo osc_item_activate_url();?>" ><?php _e('Activate''sigma'); ?></a>
            <?php ?>

You must add there also following code bellow:
Code: [Select]
            <?php if(osc_item_is_active() && osc_can_deactivate_items()) {?>
              <a href="<?php echo osc_item_deactivate_url();?>" ><?php _e('Deactivate''sigma'); ?></a>
            <?php ?>

To allow renewal of expired listings, you must also add this code:
Code: [Select]
            <?php if(osc_item_can_renew()) { ?>
              <a href="<?php echo osc_item_renew_url();?>" ><?php _e('Renew''sigma'); ?></a>
            <?php ?>

So integration into themes is quite simple  8)

Is This available for newest osclass version? also i need activate and deactive listing on user pages on gamma themes
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: omadmin on January 27, 2021, 05:00:43 PM
Did Not Work Sir... i use newest version osclass 4.3.1 and i have tested function of deactive / activate but still confuse how to correctly for this. I try on listing moderation

Code: [Select]

<?php if(osc_item_is_inactive()) {?>
 <div class="ua-premium inactive"><span><?php _e('tidak aktif''gamma'); ?></span></div>
                    <?php } else if(osc_item_is_expired()) { ?>
                       <div class="ua-premium expired"><span><?php _e('kadaluarsa''gamma'); ?></span></div>
                    <?php } else if(osc_item_is_premium()) { ?>
                      <div class="ua-premium mbBg3" title="<?php _e('Iklan Premium''gamma'); ?>"><?php _e('Premium''gamma'); ?></div>
                    <?php ?>
                  </div>


Which one is wrong?
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: MB Themes on January 27, 2021, 05:21:08 PM
You can find functional examples inside sigma theme.
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: omadmin on February 07, 2021, 05:05:50 PM
You can find functional examples inside sigma theme.

hehehe i use gamma themes.. i dont understand where is sigma
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: MB Themes on February 08, 2021, 09:31:43 AM
@omadmin
Download Sigma Osclass theme (https://osclasspoint.com/osclass-themes/general/sigma-osclass-theme-i115)
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: Smithtech on May 30, 2021, 03:56:44 AM
@support
Make sure to update user-items.php based on what you have in sigma theme.
As this feature to disable listings is new, most themes does not have implemented this option.
If you open user-items.php or loop-single.php (loop-single-premium.php), you will find code similar to this one:
Code: [Select]
            <?php if(osc_item_is_inactive()) {?>
              <a href="<?php echo osc_item_activate_url();?>" ><?php _e('Activate''sigma'); ?></a>
            <?php ?>

You must add there also following code bellow:
Code: [Select]
            <?php if(osc_item_is_active() && osc_can_deactivate_items()) {?>
              <a href="<?php echo osc_item_deactivate_url();?>" ><?php _e('Deactivate''sigma'); ?></a>
            <?php ?>

To allow renewal of expired listings, you must also add this code:
Code: [Select]
            <?php if(osc_item_can_renew()) { ?>
              <a href="<?php echo osc_item_renew_url();?>" ><?php _e('Renew''sigma'); ?></a>
            <?php ?>

So integration into themes is quite simple  8)


Can these functionalities be added to the Gamma theme once and for all? I have done this before but it is nowhere to be found today because I have updated the theme several times. It is becoming confusing and you will have to be checking which theme files to add the code to.
And also, can they also appear as buttons to make the user dashboard nicer?  Redesigning that page will be very nice.

I hope this functionality has been around for a while now and can be integrated to the Gamma theme since the use of child themes to save theme customizations after updates doesn't really work.


Thank you very much.



Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: MB Themes on May 31, 2021, 08:15:05 PM
@support
It will be integrated.
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: Smithtech on June 01, 2021, 03:21:03 AM
Alright.
Thank you.
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: Nail on June 12, 2021, 12:31:02 PM
@support
It will be integrated.

When it will be integrated. I have the same problem.
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: MB Themes on June 12, 2021, 12:46:05 PM
There is solution posted wbove
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: Nail on June 12, 2021, 02:19:01 PM
In sigma theme I found this lines in loop_single. Where I must put this line in gamma theme, in loop_single or in user_items?
Title: Re: "Users can disable / de-activate listing" NOT working in Gamma
Post by: MB Themes on June 14, 2021, 07:26:41 AM
@Nail
User-items.php as gamma does not use loop-single in user area.