If you look at the function file:
/includes/functions/functions_general.php
and find the function zen_get_buy_now_button ...
you will see the code comments:
Code:
// 0 = normal shopping
// 1 = Login to shop
// 2 = Can browse but no prices
before the default code:
Code:
default:
// proceed normally
break;
add the new case statements and change that to read:
Code:
// cannot be added to the cart
//do not show if not logged in
case ($_SESSION['customer_id'] < 1 && $product_id == 12):
return '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . TEXT_LOGIN_TO_SHOP_BUTTON_REPLACE . '</a>';
break;
case ($_SESSION['customer_country_id'] == 204 && $product_id == 12):
return 'Invalid Switzerland';
break;
and can add the code:
Code:
// cannot be added to the cart
//do not show if not logged in
case ($_SESSION['customer_id'] < 1 && $product_id == 12):
return '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . TEXT_LOGIN_TO_SHOP_BUTTON_REPLACE . '</a>';
break;
case ($_SESSION['customer_country_id'] == 204 && $product_id == 12):
return 'Invalid Switzerland';
break;
default:
// proceed normally
break;
Now the customer has to be:
1 logged in to add products_id 12 to the cart
2 once logged in, they must NOT be from Switzerland