LemonStand Forum: Remembering cart contents - LemonStand Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Remembering cart contents

#1 User is offline   gatkins 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 80
  • Joined: 18-January 11

Posted 25 March 2011 - 01:20 AM

Hi guys,


I see that if a customer logs in and puts items in their cart, then closes the browser - that these items will still be in their cart when they next visit the site.

Is there a time limit on how long these items will be saved for, and is this configurable? Otherwise is there a way to clear these items when they next visit the site?

I wouldn't mind items hanging round for a couple of hours or a day, but any longer and I think it will confuse users.

Cheers,
George.
0

#2 User is online   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,626
  • Joined: 31-October 09

Posted 27 March 2011 - 04:10 PM

Hi, George!

For registered customers LemonStand keeps the cart content in the database forever. You have the following options

  • Check the Settings/eCommerce Settings page and select a suitable cart behavior.
  • Alternatively you can implement a hander for the onFrontEndLogin event in a custom module and empty the cart each time when a customer logs in.

Thank you

#3 User is offline   gatkins 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 80
  • Joined: 18-January 11

Posted 27 March 2011 - 10:48 PM

Hi Aleksey,

I have already set cart behavior to Override - so that should handle those that login with items in their guest cart.

However the tricky bit is for registered customers who don't logout, so they are already logged in when they next visit the site. I am assuming onFrontEndLogin only gets fired when they next actually log in. Is there an event for when they next access the site as oppose to login? Perhaps then I could then check for items that have been in the cart for more than x number of hours and delete them?

Thanks,
George.
0

#4 User is online   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,626
  • Joined: 31-October 09

Posted 28 March 2011 - 03:05 PM

Hi, George!

There is no way to delete "old" items from the cart at the moment, even with API. Honestly, I think it is a wrong approach to remove items from the cart automatically. Customers may not like it. I sometimes leave items in different online store's carts intentionally, because I want to buy them later. If they removed my items, I would forget about them. And they would lose their money.

Thank you

#5 User is offline   gatkins 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 80
  • Joined: 18-January 11

Posted 28 March 2011 - 04:00 PM

Hi Aleksey,

I have to disagree - in our case we will have an online food site where people will buy a whole lot goods and quantities at one time (likely 20 items or more) perhaps monthly. If they started an order, and then came back a week or two later and started adding items to their cart again I imagine most customers would either:
A ) be very confused when going to the cart that the quantities and items are different to what they had just added - and end up not being very confident with us and the website
B ) go ahead with the order without realising, which would have the even worse consequence of them paying for and receiving items they did not want - users should be more careful when reviewing, but I can definitely still see this happening (especially with different quantities).

Perhaps there are work arounds for this:

- I assume I can at least clear the whiole cart? I found a reference to this in the forums Shop_Cart::remove_active_items();
- is there any way to get a date of when items were last added to the cart? or could I create this as an extra field myself added onto the cart or cart item - which I fill on adding an item to the cart?
- I also assume I can remove an individual cart item via code - as you can in the cart page through the UI anyway (I can't look at the code right now to check)

I am thinking that I could either:
- force users to login every time (which is undesirable - but without a remember me type functionality I might have to do this anyway) and then use the onFrontEndLogin event to clear out the cart or individual objects, or direct the user to a page showing what has been saved in their cart from last time they visited; or
- I could display some kind of warning or info box or the main page and cart page if they have items that are over a day old in their cart - and allow them to empty this out or view the contents

Thanks for the help,
George.
0

#6 User is online   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,626
  • Joined: 31-October 09

Posted 29 March 2011 - 06:58 PM

Hi, George!

We added the created_at datetime field to the shop_customer_cart_items table (will publish the update today).

You can remove old cart item with a simple query, for example, to delete items which are older than 30 days:

delete from shop_customer_cart_items  where datediff(NOW(), created_at) > 30


I'm not sure about a place where you can execute the query. Perhaps you can use the cms:onBeforeDisplay event and execute the code only once per user session. Alternatively you can implement an access point in your custom module and delete old items with Cron.

I hope this helps.

Thank you

#7 User is offline   csclothing 

  • Member
  • Group: Members
  • Posts: 2
  • Joined: 06-May 11

Posted 06 May 2011 - 04:40 AM

Registered customers having products saved in the cart for an indefinate period is causing inventory problems as it appears that they can resume their order, place it and pay for it even with an "out of stock" item in the cart.

Is there any way that when they resume their order, any items not in stock at the point of payment can be removed from the cart.

Thanks

Debbie
0

#8 User is online   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,626
  • Joined: 31-October 09

Posted 08 May 2011 - 02:53 PM

Hi, Debbie!

I added this task to the roadmap. If you do not want to wait until we implement the feature, you can implement a simple check in PHP, on the Checkout (or Cart, or both) page. The code should check whether all products in the cart are available and remove products which are not available. I also think you should display a notification, saying that some products have been removed automatically.

Thank you

#9 User is offline   csclothing 

  • Member
  • Group: Members
  • Posts: 2
  • Joined: 06-May 11

Posted 09 May 2011 - 08:15 AM

 Aleksey, on 08 May 2011 - 02:53 PM, said:

Hi, Debbie!

I added this task to the roadmap. If you do not want to wait until we implement the feature, you can implement a simple check in PHP, on the Checkout (or Cart, or both) page. The code should check whether all products in the cart are available and remove products which are not available. I also think you should display a notification, saying that some products have been removed automatically.

Thank you


Thanks Aleksey, that's very helpful

Debbie
0

Share this topic:


Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users