*

Udjen

  • **
  • 7 posts
Disable price display in selected categories
« 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

*

MB Themes

Re: Disable price display in selected categories
« Reply #1 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.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Udjen

  • **
  • 7 posts
Re: Disable price display in selected categories
« Reply #2 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>

*

MB Themes

Re: Disable price display in selected categories
« Reply #3 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
« Last Edit: February 08, 2022, 10:08:56 AM by MB Themes »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Udjen

  • **
  • 7 posts
Re: Disable price display in selected categories
« Reply #4 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

*

MB Themes

  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Udjen

  • **
  • 7 posts
Re: Disable price display in selected categories
« Reply #6 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! 👍👍👍💪💪💪

*

MB Themes

Re: Disable price display in selected categories
« Reply #7 on: February 08, 2022, 08:11:28 PM »

Functions.php, item loop, item loop premium and item.php
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots