Advertisement:

Author Topic: [Solved] How to make it osc_price_enabled_at_items() working properly?  (Read 768 times)

nithinpattazhy

  • Newbie
  • *
  • Posts: 8
Hi,

if(osc_price_enabled_at_items())

 is always giving status '1' when checking the condition, But if the price disabled for category, the value required to show is '0',. In the database, values are correct and price disabled column is 0. i want to add an else condition with if loop. But it is not working now. When I go to
 hPreference.php

function osc_price_enabled_at_items() {
       return (getBoolPreference('enableField#f_price@items'));

Where it is checking the status with database?


« Last Edit: February 19, 2017, 03:12:38 pm by nithinpattazhy »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: How to make it osc_price_enabled_at_items() working properly?
« Reply #1 on: February 19, 2017, 01:27:04 pm »
Hi,

Quote
getBoolPreference('enableField#f_price@items')

That's a general Preference (Set in Admin Dashboard by Listings / Settings => Optional fields, Price).

To check if Price is enabled for a given category:

Quote
osc_item_category_price_enabled('[Category ID]');

Replace [Category ID] with a real ID.

Regards

nithinpattazhy

  • Newbie
  • *
  • Posts: 8
Re: How to make it osc_price_enabled_at_items() working properly?
« Reply #2 on: February 19, 2017, 02:10:14 pm »
Hi,

For some categories price is disabled via setting.
Also I tried osc_item_category_price_enabled('[Category ID]'); in the page(item.php) i want to show the output.  but not getting any output. Could you please guide to access the part where query is running.
« Last Edit: February 19, 2017, 02:38:45 pm by nithinpattazhy »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: How to make it osc_price_enabled_at_items() working properly?
« Reply #3 on: February 19, 2017, 02:37:58 pm »
If what you want is to stop that message "Check with seller" from showing on listings belonging to Categories with no Price enabled, replace in item.php

Code: [Select]
if( osc_price_enabled_at_items() )
with:

Code: [Select]
if( osc_price_enabled_at_items() && osc_item_category_price_enabled(osc_item_category_id()) )
Regards

nithinpattazhy

  • Newbie
  • *
  • Posts: 8
Re: How to make it osc_price_enabled_at_items() working properly?
« Reply #4 on: February 19, 2017, 02:41:58 pm »
Thank you dear, I got exactly what I want. :)

Regards
Nithin

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: How to make it osc_price_enabled_at_items() working properly?
« Reply #5 on: February 19, 2017, 02:55:57 pm »
You're welcome. :) Please add [SOLVED] to the title of this thread editing your first message.

Regards