Post by JGAN » Sun Apr 17, 2016 7:18 pm

How can I set the shopping cart for customers who are not logged in to last a week instead of a day?

New member

Posts

Joined
Wed Jan 13, 2016 7:52 pm

Post by oc-extensions » Mon Apr 18, 2016 9:20 pm

Hi,

In last versions of opencart, cart is considered expired if is older than 1 hours and is not set customer_id

Check system/library/cart/cart.php and will find:

Code: Select all

// Remove all the expired carts with no customer ID
		$this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE customer_id = '0' AND date_added < DATE_SUB(NOW(), INTERVAL 1 HOUR)");
So, if you want to keep this "expired carts" for 7 days then change

Code: Select all

// Remove all the expired carts with no customer ID
		$this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE customer_id = '0' AND date_added < DATE_SUB(NOW(), INTERVAL 7 DAY)");

Image | Extensions and Custom Development


User avatar
Active Member

Posts

Joined
Fri Jan 06, 2012 11:31 pm

Post by JGAN » Wed Apr 20, 2016 1:07 am

Thanks!!

New member

Posts

Joined
Wed Jan 13, 2016 7:52 pm
Who is online

Users browsing this forum: No registered users and 57 guests