After re-reading the first post in this thread and going thru my checkout process a couple more times I'm gonna try and reword it a little.
spooks, on 05 March 2010 - 12:02 PM, said:
After a visitor has placed an item in thier cart and has to sign in or create a account, they go back to the index page and not to the shopping cart where they came from.
My setup never directed you to the index page or back to the shopping cart after being forced to log in. It sent you on to where the button you click in the shopping cart to check out would have sent you had you been logged in, checkout_shipping.php. If you clicked the button and then had to create an account it would then send you to the account confirmation page where you would click continue and then you were finally directed to the index page.
My code in the login.php was the same.
tep_redirect(tep_href_link(FILENAME_DEFAULT));
By replacing with this:
if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } else { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'info_message=' . 'Welcome back, You have been logged in successfully!', 'SSL')); }
it allowed for the user to see their updated cart after the visitor's and member's carts merge at log-in but it only works if your using the login.php button. Using the "Checkout" button (checkout_shipping.php) in either cart always either takes you directly or redirects you after log-in to the shipping page no matter what you had in either cart or how you change the code in login.php.
In fact, if your not logged in there is no checkout button anywhere until you add something to your cart so there is no need or anything fixed by the 3'rd change on this post unless I'm missing something. If somehow someone ended up on checkout with nothing in their cart wouldn't it automatically show empty cart?
spooks, on 05 March 2010 - 12:02 PM, said:
Another change I make is if your visitor has no items in thier cart & they click on checkout, they are taken to the login page, in my view this is not what they expect, so this change means if they click on checkout with nothing in thier cart they go to the cart.
in checkout_shipping.php:
find:
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($cart->count_contents() < 1) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
move that section to above:
// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
I need something like this that says if checkout_shipping.php is clicked while in cart and user is not logged in redirect back to cart after log-in. Instead somewhere it's saying to continue on to shipping after log-in and i don't see anything like that in the login.php file.
By reading what others have asked it looks like many have had the same issues but I didn't find anyone asking it exactly. So far the closest solution I found was to have it clear the member's cart feature after log-out so there wouldn't be a hidden merge with no chance to review the updated cart before you land on checkout_shipping.
Another solution would be if I could figure out how to show cart totals with an edit button on the shipping page like it does on the confirmation page and then cart and shipping on the payment page. Ideally if each page thru the checkout process would stack on the previous page's info all the way to the confirmation page it would make it a lot more user friendly for the consumer.
Edited by BRD-75, 04 November 2010 - 08:21 AM.