Osclass Support Forums

Osclass theme support => Veronika Osclass Responsive Theme => Topic started by: Udjen on February 04, 2022, 01:19:51 AM

Title: Disable price display in selected categories
Post by: Udjen on February 04, 2022, 01:19:51 AM
Hello

Please tell me how to disable the display of prices in the selected categories? A much needed option.

Screenshot - //prntscr.com/26o7y4h

Thank you in advance
Title: Re: Disable price display in selected categories
Post by: MB Themes on February 04, 2022, 01:46:15 PM
This require function osc_category_price_enabled() ... condition price.
Or check if item category field for price enabled is really enabled.
It was not always available.
Title: Re: Disable price display in selected categories
Post by: Udjen on February 07, 2022, 11:26:41 PM
Sorry, I'm not an expert in this area, I just need to implement it somehow. All I could find in the template is a script, which I understand needs to be changed, but I don't know how... Help implement this option. Thank you!!!

    <script>
    $(document).ready(function(){
      var cat_id = <?php echo osc_item_category_id(); ?>;
      var catPriceEnabled = new Array();

      <?php
        $categories = Category::newInstance()->listAll( false );
        foreach( $categories as $c ) {
          if( $c['b_price_enabled'] != 1 ) {
            echo 'catPriceEnabled[ '.$c['pk_i_id'].' ] = '.$c[ 'b_price_enabled' ].';';
          }
        }
      ?>

      if(catPriceEnabled[cat_id] == 0) {
        $(".item-details .price.elem").hide(0);
      }
    });
    </script>
Title: Re: Disable price display in selected categories
Post by: MB Themes on February 08, 2022, 09:45:52 AM
This is jquery part for hiding price box on publish page.
We will update theme.

//Edit: fixed in 1.6.3
Title: Re: Disable price display in selected categories
Post by: Udjen on February 08, 2022, 12:08:58 PM
I didn't notice any difference after the update. Perhaps you did not understand me.

The disabled price should also hide the block with the price on the ad page.

Advertising services have popular headings such as "Job" for example, and it is better to display salary in the filter. Therefore, it makes no sense to show a block with a value in such ads.

See photo - //prnt.sc/26qpnfv
Title: Re: Disable price display in selected categories
Post by: MB Themes on February 08, 2022, 02:33:35 PM
Listing moved to personals category where price is disabled on category.
https://veronika.mb-themes.com/personals/women-looking-for-men/apple-ipad-mini-4-i120
https://veronika.mb-themes.com/personals/women-looking-for-men
https://veronika.mb-themes.com/search/category,69/sShowAs,gallery
Title: Re: Disable price display in selected categories
Post by: Udjen on February 08, 2022, 06:59:48 PM
Ok. Sorry. I apparently accidentally downloaded version 1.6.2. 1.6.3 everything works fine. In editing the announcement, only the price remained.

It is possible to find out exactly where and what has been changed. In my theme, I made a lot of changes and if I update, I will have to collect everything again))

  You helped a lot. You are the best support! 👍👍👍💪💪💪
Title: Re: Disable price display in selected categories
Post by: MB Themes on February 08, 2022, 08:11:28 PM

Functions.php, item loop, item loop premium and item.php