Post by DaveBunny » Tue Jan 25, 2011 10:42 pm

Hi,

How can I ensure that when a user logs out all of the products in the shopping basket are removed. So that next time when a user logs in they are met with an empty shopping basket.

I'm using version 1.4.9.1.

Many Thanks

Dave

New member

Posts

Joined
Mon Jul 14, 2008 7:32 pm

Post by JAY6390 » Tue Jan 25, 2011 11:29 pm

Hi Dave

Open
/system/library/customer.php

Find and remove this code

Code: Select all

            if (($customer_query->row['cart']) && (is_string($customer_query->row['cart']))) {
                $cart = unserialize($customer_query->row['cart']);
                
                foreach ($cart as $key => $value) {
                    if (!array_key_exists($key, $this->session->data['cart'])) {
                        $this->session->data['cart'][$key] = $value;
                    } else {
                        $this->session->data['cart'][$key] += $value;
                    }
                }            
            } 

That will stop the cart loading any products previously saved

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by DaveBunny » Wed Jan 26, 2011 1:20 am

Excellent. Worked a treat!

Many Thanks

Dave

New member

Posts

Joined
Mon Jul 14, 2008 7:32 pm

Post by Qphoria » Wed Jan 26, 2011 1:29 am

Or you can make it optional for the customer:
http://forum.opencart.com/viewtopic.php ... 447#p81447

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JAY6390 » Wed Jan 26, 2011 1:59 am

*cough* need to add it to VQMods ;)

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 16 guests