warrenthewindmill Posted March 15, 2003 Share Posted March 15, 2003 I managed to get this working easily, and it looks great. the first time I tried to run it I got an error. I checked through the changes to application_top.php because with 5 changes to make that seemed the likeliest place for it to go wrong. I think I noticed a small error in the instructions: 5) Look for this section: case 'cust_order' : if (tep_session_is_registered('customer_id')) { if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid'], 'NONSSL')); } else { $cart->add_cart($HTTP_GET_VARS['pid'], 1); and replace it with this: case 'cust_order' : if (tep_session_is_registered('customer_id')) { if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) { // Although the product has attributes we still delete it from the WISHLIST: if ($rfw == 1) tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$pid"); tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid'], 'NONSSL')); } else { // First delete from wishlist: if ($rfw == 1) tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$pid"); $cart->add_cart($HTTP_GET_VARS['pid'], 1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters), 'NONSSL')); break; If you do as suggested above you will get an error because you haven't overwritten all the code you should have. You should actually overwrite: case 'cust_order' : if (tep_session_is_registered('customer_id')) { if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid'], 'NONSSL')); } else { $cart->add_cart($HTTP_GET_VARS['pid'], 1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters), 'NONSSL')); break; note the additional bit: } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters), 'NONSSL')); break; Otherwise you end up with the last section (starting with the 2 sets of closing brackets) twice I hope this is clear enough to follow and that the author of the contribution won't think I'm being critical. I just thought it might help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.