Totally Zenned
- Join Date:
- Apr 2007
- Location:
- Herts. UK
- Posts:
- 893
- Plugin Contributions:
- 0
Checkout when not logged in or with empty cart
Hi,
In ZenCart v1.3.7 trying to checkout when not logged in or when your cart is empty sends you to the timeout page.
In includes\modules\pages\checkout_shipping\header_php.php the code says:
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($_SESSION['cart']->count_contents() <= 0) {
zen_redirect(zen_href_link(FILENAME_TIME_OUT));
}
I think this should read:
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($_SESSION['cart']->count_contents() <= 0) {
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
This will redirect the user to the shopping cart page rather than the time out page if their cart is empty.
Also the above code should be moved so that it is after the checks to see if the user is logged in. The user will then be correctly redirected to the login page if they are not logged in rather than being sent to the timeout page.
Hope this helps.
Christian.