Guest Posted September 5, 2003 Posted September 5, 2003 I want to change the end of create_account_process.php so that it will go to create account success if the shopping cart is empty, and if they have something in their account, ie. they have been prompted to create an account because they want to go through checkout, to be taken straight to checkout shipping. Will this do it? Change: tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL')); to: if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL')); } if ($cart->count_contents() => 1) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } TIA
Guest Posted September 5, 2003 Posted September 5, 2003 looks ok to me - although I would do this instead if ($cart->count_contents() > 0) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } else { tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL')); } firstly it will be faster - and it isn't good practice to not have a default place to redirect.
Guest Posted September 5, 2003 Posted September 5, 2003 Great, thank you. I nicked it from another part of the software, changed the link and wasn't sure if I had got it quite right. I will put in what you said. :D
Guest Posted September 5, 2003 Posted September 5, 2003 Cool - works fine. Was getting parse errors at first but I had accidentally deleted the } after the bit I replaced. Once I realised and put it back, it was OK. Thanks again. :D
Recommended Posts
Archived
This topic is now archived and is closed to further replies.