I would like to set up LOGIN FOR PRICE, but only for 1 category (or product) is this possible?
I have already set it up for browse only, login for pricing.
I would like to set up LOGIN FOR PRICE, but only for 1 category (or product) is this possible?
I have already set it up for browse only, login for pricing.
You would need to address the Price and the Add to Cart button ...
In the functions_general.php in the function zen_get_buy_now_button ...
You can add the code in RED:
In the function file function_prices in the function zen_get_products_display_price you can add the code in RED:Code:// bof: Login for Price button $chk_login_for_price = false; $chk_category_sql = "SELECT master_categories_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . (int)$product_id . "'"; $chk_category = $db->Execute($chk_category_sql); if ($_SESSION['customer_id'] ==0 && in_array((int)$chk_category->fields['master_categories_id'], array(10, 12)) ) { $login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE . '</a>'; return $login_for_price; } // eof: Login for Price button $button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
Note: you will want to look at the Products in the Product Listing, Centerboxes and Product _info ... to determine how you want these to read as sometimes both will display at the same time ...Code:// show case only if (STORE_STATUS != '0') { if (STORE_STATUS == '1') { return ''; } } // bof: Login for Price $chk_login_for_price = false; $chk_category_sql = "SELECT master_categories_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . (int)$products_id . "'"; $chk_category = $db->Execute($chk_category_sql); if ($_SESSION['customer_id'] ==0 && in_array((int)$chk_category->fields['master_categories_id'], array(10, 12)) ) { return TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE; } // eof: Login for Price
Last edited by Ajeh; 25 Sep 2011 at 03:46 PM.
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
just add this code in red? Where I distinguish WHICH 1 category requires login for price
thankyou,
Just add this code in red?
Where do I distinguish which 1 category requires login for price?
Find the Master Categories ID for the Products ...
What is the immediate Category that the Products are in?
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
cat id 112
Then you would change:
array(10, 12)
to read:
array(112)
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
I have made changes to 1 page only here; Still need login for all
In the function file function_prices in the function zen_get_products_display_price you can add the code in RED:
Code:
------------------------------------------------------------------------
// show case only
if (STORE_STATUS != '0') {
if (STORE_STATUS == '1') {
return '';
}
}
// bof: Login for Price
$chk_login_for_price = false;
$chk_category_sql = "SELECT master_categories_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . (int)$products_id . "'";
$chk_category = $db->Execute($chk_category_sql);
if ($_SESSION['customer_id'] ==0 && in_array((int)$chk_category->fields['master_categories_id'], array(112)) ) {
return TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE;
}
// eof: Login for Price
What else do I need? to require login for ONLY cat id 112
Look at post #2 for function zen_get_buy_now_button ...
You need to add that code to and change the array to 112 ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Still unclear did you want me to add this;
to
to functions_general.php in the function zen_get_buy_now_button
???
if so where exactly?
-------------------------------
// bof: Login for Price button
$chk_login_for_price = false;
$chk_category_sql = "SELECT master_categories_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . (int)$product_id . "'";
$chk_category = $db->Execute($chk_category_sql);
if ($_SESSION['customer_id'] ==0 && in_array((int)$chk_category->fields['master_categories_id'], array(112)) ) {
$login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE . '</a>';
return $login_for_price;
}
// eof: Login for Price button
$button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
Bookmarks