So we are using OC 2.3.0.2 and have an abandoned cart email that gets sent from Mailchimp after 6 hours. When the link is clicked it directs the customer to the Cart Page here: https://garrysun.com/index.php?route=checkout/cart
The problem is that if they aren't logged in there may be nothing in their cart and they are sent to a 404 error page (you can see this in the link above).
Due to a bunch of broken links on our site, I am going to automatically redirect all 404 errors to the home page which would cause the cart page to get redirected automatically as well.
Is there a way to say... if the cart is empty send them to the login page so that they don't get the 404 page but if the cart has items or they are logged in then let them continue to the cart page?
Any ideas?
Why does the checkout/cart page show 404? That's the main issue...
It should show the empty cart message. if you want to redirect to login on empty then you can do the following.
But until you fix that 404 issue, it will never find the cart page to check that code.
1. EDIT: catalog/controller/checkout/cart.php
2. FIND:
3. AFTER, ADD:
It should show the empty cart message. if you want to redirect to login on empty then you can do the following.
But until you fix that 404 issue, it will never find the cart page to check that code.
1. EDIT: catalog/controller/checkout/cart.php
2. FIND:
Code: Select all
public function index() {
Code: Select all
if (!$this->customer->isLogged() && !$this->cart->hasProducts() && empty($this->session->data['vouchers']) ) {
$this->response->redirect($this->url->link('account/login'));
}
Who is online
Users browsing this forum: No registered users and 266 guests