I’ve worked on this for a bit.. and there are a few things that can be done to keep it simple:
-
Make sure the field on the “View Cart” page has a min, max, pattern, make it read only and hide the buttons if the line item of the cart contains a word (for example). Make sure that the sidebar cart has the exact same stuff in it.
-
Make sure that the product page or the button that you have implemented on any page is only there if the item isn’t already in the cart. There’s code floating around for this in this community.
And for now.. if you want to keep it simple..:
- For those same product page or button.. make sure that it redirects to the cart (add hidden input field called return_to and give value of /cart. (or add this to the href string)
I’m trying to get some javascript together that would go around this last one.. because I have a page where the customer needs to stay on the page after the ‘add to cart’ click, but needs to check if the item is in the cart. It does find it in the cart, but can’t figure out yet how to prevent to have it actually add to the cart…