New Zenner
- Join Date:
- Jul 2007
- Posts:
- 30
- Plugin Contributions:
- 0
Display prices for featured products where login normally required
I am the developer for the Blick Industrial site. The site is set up to only display prices to approved account customers. However, the company wants everyone to be able to see the prices for the new featured products that appear on the main page—"One Week Specials"—while still having this driven from the database.
It seems to me I need to edit admin>includes>functions>functions_prices.php. The following seems to be the key section of the code. I have tried something like an if statement around it:
if !$this_is_home_page {
switch (true) {
case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):
// customer must be logged in to browse
return '';
break;
case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
// customer may browse but no prices
return '';
break;
default:
// proceed normally
break;
}
}
I've also tried just including that variable in the case being checked for:
// verify display of prices
switch (true) {
case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '' and !$this_is_home_page):
// customer must be logged in to browse
return '';
break;
case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == '' and !$this_is_home_page):
// customer may browse but no prices
return '';
break;
default:
// proceed normally
break;
}
Finally, I've tried modifying the following section too (unmodified code shown here):
// show case only
if (STORE_STATUS != '0') {
if (STORE_STATUS == '1') {
return '';
}
}
But I can't seem to get it to work. Am I on the right track, and can anyone lend a hand? :)