Osclass Support Forums
Osclass theme support => Veronika Osclass Responsive Theme => Topic started 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
-
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.
-
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>
-
This is jquery part for hiding price box on publish page.
We will update theme.
//Edit: fixed in 1.6.3
-
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
-
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
-
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! 👍👍👍💪💪💪
-
Functions.php, item loop, item loop premium and item.php