This is a discussion on Prices for Logged-In Users Only within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; I found this problem in the forum: "after adding the "Prices for Logged-In Users Only" and "restricted_website" contribs, the add ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| ||||
| ||||
| I found this problem in the forum: "after adding the "Prices for Logged-In Users Only" and "restricted_website" contribs, the add to cart button now does not work in the products listing page when a customer is logged in. The customer would need to go into the product information page in order to add the item into the cart. Does have a SSL cert cause this problem? Any suggestions? Which codes do you need to see in order to help me? Thanks in advance." THE SOLUTION The problem is that the modifcation made in file APPLICATION_TOP.PHP is incorrect. FIND THIS CODE: // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; // performed by the 'buy now' button in product listings and review page case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) { if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } else { $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; and REPLACE WITH // customer adds a product from the products page case 'add_product' : if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } else { if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); } break; // performed by the 'buy now' button in product listings and review page case 'buy_now' : if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } else { if (isset($HTTP_GET_VARS['products_id'])) { if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } else { $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); } break; It should work now (see attachment for full install) More...
__________________ Michael Sasek osCMax Developer
|
| Sponsored Links | ||
| ||
| |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Being logged off after searching admin site | aeava | osCMax v2 Customization/Mods | 7 | 03-15-2007 10:57 AM |
| how do you hide item prices until customer has logged in? | CLK | osCMax v1.7 Discussion | 0 | 12-15-2005 03:57 PM |
| Special Prices change to £0 when logged in !!! | fuzioneer | osCMax v1.7 Discussion | 2 | 06-10-2005 05:45 AM |
| Can't stay logged-in... | artloftart | osCommerce 2.2 Installation Help | 2 | 07-21-2004 12:17 PM |
| logged in user asked to login when trying to write a review | faster | osCMax v1.7 Discussion | 2 | 10-24-2003 07:42 AM |