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.
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.
it's not a mistake it's a design decision.wakabayashi wrote:Yes I have exactly the same problem! Does anybody have a solution for this mistake?
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
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.
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.
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.
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.
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:It is the way most carts work tbh.
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.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.
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.
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
add after
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) {
Code: Select all
$this->db->query("UPDATE " . DB_PREFIX . "customer SET cart = '' WHERE customer_id = '" . $customer_query->row['customer_id'] . "'");
My bad, actually it does work with this proper explanation...
find...
and replace with...
thats worked for me anyway!
HTH
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'] . "'");
Code: Select all
$this->db->query("UPDATE " . DB_PREFIX . "customer SET cart = '' WHERE customer_id = '" . $customer_query->row['customer_id'] . "'");
HTH
Im available for OpenCart Design Layout Customisation & ideas.
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?
Should I add [solved], or leave thread open as it's my next version feature request?
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.
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.
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
I found the general area and tbh was waiting for your solution as I thought you had it in hand
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.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'..
Please use proper English at all times, so that all members may understand you.
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.
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
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
Is this a normal exit quote? "safe to leave the computer" ? Surely safe to leave this website or something would be better?werepair wrote:You have been logged off your account. It is now safe to leave the computer.
Im available for OpenCart Design Layout Customisation & ideas.
Who is online
Users browsing this forum: No registered users and 25 guests