Post by AnonyMoose » Thu Sep 01, 2011 6:29 am

Some of my customers are confused by shopping cart being saved when they log off. Basically, customer adds items to the basket, decides not to buy and logs off, most of them don't bother to read message explaining cart being saved or simply forget about it soon.

Same customer comes back in few days/weeks/months, adds items to the shopping cart and when he logs in on the checkout page to complete transaction, discovers extra items added to current cart from previous saved session.

Most customers use Wish List if they want to save items for later anyway, so it would be good to have ENABLE/DISABLE option for this function in the Admin panel.
Last edited by AnonyMoose on Fri Sep 30, 2011 4:34 am, edited 1 time in total.

New member

Posts

Joined
Wed Jul 20, 2011 5:35 pm

Post by wakabayashi » Wed Sep 07, 2011 5:00 am

Yes I have exactly the same problem! Does anybody have a solution for this mistake?

New member

Posts

Joined
Thu Aug 04, 2011 2:55 am

Post by Xsecrets » Wed Sep 07, 2011 6:39 am

wakabayashi wrote:Yes I have exactly the same problem! Does anybody have a solution for this mistake?
it's not a mistake it's a design decision.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by mberlant » Wed Sep 07, 2011 9:39 am

It's wonderful to learn that it is a design element instead of a mistake. That does not make it any more desirable.

I would now like to join the chorus in asking how to reverse this behavior, so that the cart gets emptied out at the end of any incomplete session.

Please use proper English at all times, so that all members may understand you.


User avatar
Active Member

Posts

Joined
Sun Mar 13, 2011 8:33 pm

Post by uksitebuilder » Wed Sep 07, 2011 7:02 pm

It is the way most carts work tbh.

I agree that it is a little irritating. I have been irritated by it many times when testing a site/account

As a fix, I propose that the cart be emptied after a specified cart lifetime.

The cart data is stored in the 'customer' table in the 'cart' column

Unfortunately, there is no 'last_login' date/time or 'last_action' date/time column in the table which would have been ideal to be used as a point in time from which to empty their cart.

So, this would need to be added and a function added to the login function (or index.php if logging last action) to update the the new column in the database.

Then finally either a cron job should be run hourly (or whenever) or script attached to index.php/startup.php to run a secondary script to empty the carts where the data/time in our new column is older than the time we specify as the cart lifetime.

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by mberlant » Thu Sep 08, 2011 10:14 pm

uksitebuilder wrote:It is the way most carts work tbh.
That's not my experience when shopping at any of the larger online enterprises, but your comment and my reply get neither of us closer to a solution.
uksitebuilder wrote:Unfortunately, there is no 'last_login' date/time or 'last_action' date/time column in the table which would have been ideal to be used as a point in time from which to empty their cart.
As I was pondering how to flesh out your suggestion, I had an epiphany. The best way to implement your suggestion is by not implementing your suggestion. As it turns out, we don't really care why or how long ago the customer abandoned the cart.

While we do not have any way of knowing how long a customer has been idle, we do know specifically when to trash the cart the customer abandoned after his last session. The time to trash the abandoned cart is whenever the customer is required to log in anew.

At the time of customer login his "customer cart" should be flushed prior to moving his "unknown customer session cart's" contents, if any, into the "known customer cart" for continued shopping and/or checkout.

Or, am I missing something here?

Please use proper English at all times, so that all members may understand you.


User avatar
Active Member

Posts

Joined
Sun Mar 13, 2011 8:33 pm

Post by uksitebuilder » Thu Sep 08, 2011 11:11 pm

Hey, I thought really long and hard about my suggestion lol

It's difficult to answer one post on these forums and spend anymore time than 5 minutes on it.

I just usually go with my brain first thrashes out otherwise I would spend all day and night on here (instead of just all day)

BUT, your solution sounds better to flush the cart on login.

i thought it would be as simple as doing the following, but must be missing something somewhere

in system/library/customer.php

find

Code: Select all

		if ($customer_query->num_rows) {
add after

Code: Select all

$this->db->query("UPDATE " . DB_PREFIX . "customer SET cart = '' WHERE customer_id = '" . $customer_query->row['customer_id'] . "'");

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by mberlant » Thu Sep 08, 2011 11:46 pm

Great! I will use your snippets of code to try to get further -- when my brain is less foggy. Thanks.

Please use proper English at all times, so that all members may understand you.


User avatar
Active Member

Posts

Joined
Sun Mar 13, 2011 8:33 pm

Post by AnonyMoose » Thu Sep 22, 2011 4:42 am

Any chance you figured out how to solve this? I'll owe you a pint if so! :-)

New member

Posts

Joined
Wed Jul 20, 2011 5:35 pm

Post by j8yba » Fri Sep 23, 2011 8:40 pm

its doesnt work for me. items still there.

Im available for OpenCart Design Layout Customisation & ideas.


New member

Posts

Joined
Tue Sep 21, 2010 5:07 am

Post by j8yba » Fri Sep 23, 2011 8:49 pm

My bad, actually it does work with this proper explanation...

find...

Code: Select all

$this->db->query("UPDATE " . DB_PREFIX . "customer SET cart = '" . $this->db->escape(serialize($this->session->data['cart'])) . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "' WHERE customer_id = '" . (int)$this->session->data['customer_id'] . "'");
and replace with...

Code: Select all

$this->db->query("UPDATE " . DB_PREFIX . "customer SET cart = '' WHERE customer_id = '" . $customer_query->row['customer_id'] . "'");
thats worked for me anyway!

HTH

Im available for OpenCart Design Layout Customisation & ideas.


New member

Posts

Joined
Tue Sep 21, 2010 5:07 am

Post by AnonyMoose » Sun Sep 25, 2011 4:58 am

Works fine now, thanks to both of you for helping!

Should I add [solved], or leave thread open as it's my next version feature request?

New member

Posts

Joined
Wed Jul 20, 2011 5:35 pm

Post by mberlant » Sun Sep 25, 2011 8:00 am

I think I would add [SOLVED] after [REQUEST] to show that both indicators are active, and that there is code available to work into the new release.

I would also like to add how pleased I am that four forum members built upon each other's thoughts to arrive at a workable solution in such a short time. Sorry to contradict you, Simon, but spilling your incomplete thoughts when you did was just the spark we needed.

Cheers.

Please use proper English at all times, so that all members may understand you.


User avatar
Active Member

Posts

Joined
Sun Mar 13, 2011 8:33 pm

Post by uksitebuilder » Sun Sep 25, 2011 6:22 pm

That's what the community is for.

I found the general area and tbh was waiting for your solution as I thought you had it in hand :)

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by AnonyMoose » Tue Oct 04, 2011 6:05 am

Once you've done it, it's worth changing logout message in catalog\language\english\account\logout.php so it doesn't say 'your cart has been saved'..

New member

Posts

Joined
Wed Jul 20, 2011 5:35 pm

Post by mberlant » Tue Oct 04, 2011 3:52 pm

AnonyMoose wrote:Once you've done it, it's worth changing logout message in catalog\language\english\account\logout.php so it doesn't say 'your cart has been saved'..
Good catch. It is always a good idea to tidy up. I didn't think of this in this case because I don't think I have found myself ever, nor observed anyone else ever, pushing the "Log out" button instead of simply abandoning the page.

Please use proper English at all times, so that all members may understand you.


User avatar
Active Member

Posts

Joined
Sun Mar 13, 2011 8:33 pm

Post by j8yba » Tue Oct 04, 2011 5:00 pm

Cant believe this isnt a feature by default anyway!

Im available for OpenCart Design Layout Customisation & ideas.


New member

Posts

Joined
Tue Sep 21, 2010 5:07 am

Post by AnonyMoose » Tue Oct 04, 2011 7:17 pm

j8yba wrote:Cant believe this isnt a feature by default anyway!

I guess it makes sense in some cases, Amazon for example does it and I quite often add some books to the cart, come back after few days and add more to buy them all etc, but I'd rather have option of disabling it.


It would be nice to have some cookies keeping cart for a day or something though, so it won't get empty every time customer closes his browser.

New member

Posts

Joined
Wed Jul 20, 2011 5:35 pm

Post by werepair » Tue Oct 04, 2011 7:36 pm

After reading this thread i have now made a vQmod file for 1.5.1.3 if anyone wants it,
all i have done is made the vQmod file "the mod is not my work"

you will also see this message when you logout

Account Logout

You have been logged off your account. It is now safe to leave the computer.

Your shopping cart has not been saved.

best regards

Attachments

Disable shopping cart saving 1.5.1.3 - vQmod


User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by j8yba » Tue Oct 04, 2011 7:43 pm

werepair wrote:You have been logged off your account. It is now safe to leave the computer.
Is this a normal exit quote? "safe to leave the computer" ? Surely safe to leave this website or something would be better?

Im available for OpenCart Design Layout Customisation & ideas.


New member

Posts

Joined
Tue Sep 21, 2010 5:07 am
Who is online

Users browsing this forum: No registered users and 13 guests