KJ666 Posted November 24, 2009 Posted November 24, 2009 I have lost this i have seen it somwhere. What i would like is when a customer signs in it takes them stright to there cart, not the home page.
multimixer Posted November 24, 2009 Posted November 24, 2009 I have lost this i have seen it somwhere. What i would like is when a customer signs in it takes them stright to there cart, not the home page. Here is the code that manage the redirection in login.php if (sizeof($navigation->snapshot) > 0) { $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); $navigation->clear_snapshot(); tep_redirect($origin_href); } else { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } You can change the FILENAME_DEFAULT (=index) to whatever you like. I just wonder, what will happen if the customers cart is empty? My community profile | Template system for osCommerce - New: Responsive | Feedback channel
KJ666 Posted November 26, 2009 Author Posted November 26, 2009 WOuld somthing like this work ? if (sizeof($navigation->snapshot) > 0) { $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); $navigation->clear_snapshot(); tep_redirect($origin_href); } else { if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } else { tep_redirect(tep_href_link(FILENAME_CART)); } } Im not sure if you can have two else codes ?? anyone know ?
KJ666 Posted November 26, 2009 Author Posted November 26, 2009 Well i went a head and tested this: (got filename wrong in above post) if (sizeof($navigation->snapshot) > 0) { $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); $navigation->clear_snapshot(); tep_redirect($origin_href); } else { if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } else { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } } And so far it works a treat not found a problem yet (unless any of you see a problem with that code)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.