Jump to content

Simple shopping cart based on sessions


Recommended Posts

Posted

Hi.

I have a client request to implement simple shopping cart without registration and other basic shop features as order history etc., I was thinking to use sessions for it. Have somebody done something similar? What are pros and cons?  Pitfalls that should be avoided? 

Thank in advance!

Posted

I've done a simple cart functionality with sessions. Works great. However, if you want to keep the infos longer than the browser session, you should use cookies instead.

One thing to consider, however (mainly from a usability POV):

Users tend to switch devices constantly. They browsed the product catalogue yesterday on their laptop, and want to continue browsing your site today on their tablet or phone. If you don't want to use registration / login, you could implement a simple bookmarking feature: Let the user create an individual bookmark (URL) for his selection, so he can continue on another device and even with another browser. This could also be used as a feature for wishlists, or product comparison tables which have become standard features in today's e-commerce world.

  • Like 3
Posted

I built a simple cart system using JS + Local Storage; works perfectly and the cart contents last a long time; This is for visitors to collect swatch samples and then be able to request those samples in a form; there is no ecommerce in this case, but once you have the cart, it shouldn't be hard to use that data to interact with a 3rd party payment system.

  • Like 4
Posted

Thanks for replies. 

@bernhard Great site, that's the perfect example of what I need. Several notices:

I think that the cart page should contain

<meta name="robots" content="noindex">

and if there are no items in the cart it would better to show something like "Your cart is empty" without form. IMHO. 

 

21 hours ago, Zeka said:

cart without registration and other basic shop features as order history

 

 

  • Like 1
Posted
3 hours ago, bernhard said:
1 hour ago, Zeka said:
  22 hours ago, Zeka said:

cart without registration and other basic shop features as order history

I think you would need a login for the clients then.

:P;) You can do shopping history with cookies - but I doubt how useful that would be... as dragan already mentioned users can switch devices and the history would be lost...

 

1 hour ago, Zeka said:

<meta name="robots" content="noindex">

and if there are no items in the cart it would better to show something like "Your cart is empty" without form. IMHO. 

true, thx

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...