Editing cart contents -- esp products with attributes
On our site, all of our products have a great many attributes. It is common for a customer to set some options and add to their cart but then want to edit those options later on.
However currently doing so, does not edit the existing products attributes in the cart, but adds another product to the cart. Needless to say, this is not what most customers consider intuitive.
Is there a setting I can change to allow users to edit the cart contents? Or do I need to make coding changes to achieve this? Thanks
Justin
http://www.kuroobiya.com
Re: Editing cart contents
It's a good idea, but would require custom coding.
Re: Editing cart contents
Bummer. But I wondered if that were the case. I have no option really but to do make those changes. I figured I would add some logic to the add to the cart processing to delete the existing item, and then add it again with the new option settings.
Does that sound like the right approach?
Re: Editing cart contents
Not really. The cart exists behind the scenes as a multi-dimensional session array. Rather than trying to remove parts of it, it would be more straightforward simply to update those specific values that have been changed.
Just to warn though, you're heading into some reasonably complex code.
Re: Editing cart contents
Hmmm. Well I will give it a bash and post back here with how it all goes.:blush:
Re: Editing cart contents
OK. I did it and it was not so tricky in the end.
You can get it from the Zen Cart downloads page. It is called Edit Cart.
And you can see it in action at kuroobiya.com
Re: Editing cart contents -- esp products with attributes
Nice job. Not what I had envisaged, which was the ability to change an attribute without leaving the shopping cart, but in your case where the attributes are many and really need the support of the additional information on the product_info page, an appropriate and elegant way of achieving the objective. Good solution. Thanks for sharing.
Re: Editing cart contents -- esp products with attributes
And it seems that somebody else wanted this to work exactly as you've designed it!
Re: Editing cart contents -- esp products with attributes
Hi,
I'm the "someone else" that kuroi mentioned. Love the mod ... you've saved me from a lot of hassle trying to do this myself!
I found a small problem with the distribution zip file. The "edit_cart_button_names.php" file should be in /languages/english/extra_definitions/TEMPLATE_NAME, not /languages/english/TEMPLATE_NAME/extra_definitions.
Thanks again. I hope others find it as useful as I do.
Possum.
MODERATOR NOTE: distribution zip file has been updated.
Re: Editing cart contents -- esp products with attributes
Hi,
I do not have any mandatory attributes, so I'd like to be able to allow customers to add the product to their cart directly from the product listing without going via the info page. With the new Edit Card mod, they can then go back and add the attributes (gift wrapping in my case) when they want to.
I guess nobody has tried to do this before because without the Edit Cart mod it doesn't make sense.
I went to the /includes/modules/MY_TEMPLATE/product_listing.php and commented out the "if" logic that puts up the "more info" message for products with attributes. That worked well and the resulting "buy now" button does indeed point to the "buy now" action.
Strangely, however, clicking on that link does not go to the checkout but instead takes me to the product info page to configure the product. This is strange because, as I mentioned, the attributes are not required, and the link was supposed to take me to the checkout.
Any thoughts gratefully received.
Thanks
Possum.