Re: Editing cart contents -- esp products with attributes
Hi Pasmith,
There's a better way to suppress your quantities box without setting it to 1 so that it has this negative effect on this mod.
I don't know what it is offhand, but I know I've seen it here on the form.
I would go to the section of the form for customizing and set up and search for 'hide quantities box" or "turn off quantity box" or something of that nature.
I'm confident you'll be able to find the answer to that particular issue. And perhaps it will solve this one for you.
Re: Editing cart contents -- esp products with attributes
Hey ScriptJunkie
Sorry I got here a bit late, Ah, I had a wee squiz at your site. ( I am guessing it is empowermentsanctuary.com)
The edit cart mod won't work if are not using attributes. The line that you quoted:
Code:
if(is_numeric($_GET['products_id'])) {
$cartAction="add_product";
}else{
$cartAction = "edit_product_in_cart";
}
is in fact the heart of the matter. If you are using attributes those attributes will be passed in as a hash in the products_id and it won't be numeric. If you are not using attributes, the products_id will always be numeric. Try adding some attributes to one of your test products (eg size : small, medium , large) and see if it works then.
Good luck
Justin
Re: Editing cart contents -- esp products with attributes
Hi Pasmith
Sorry to be a bit slow, I hope you solved it, but if not ...
I can't be sure what is wrong with your setup, but your guess that it is to do with the max quantity would be my guess too.
The mod first adds the edited product as a new product, so that you have two items in your cart. Provided there was no error in doing so, it then deletes the original item. Leaving you with just one product.
If however the new product could not be added, but no error was thrown, then the old product would be deleted leaving nothing in the cart.
Have you tried removing the max product quantity restriction? If you do this and it works, you could just leave it like that. But if that is not satisfactory, I would change
Code:
if ((zen_get_products_quantity_order_max($_POST['products_id']) == 1 and $_SESSION['cart']->in_cart_mixed($_POST['products_id']) == 1)) {
to
Code:
if ((zen_get_products_quantity_order_max($_POST['products_id']) == 1 and $_SESSION['cart']->in_cart_mixed($_POST['products_id']) == 2)) {
or if you are feeling particularly bold
change it to
since this code was copied from the standard add_to_cart action, but is only called when editing a product, so in actual fact is redundant.
There may be other places that you need to change. If this is all above your head, I can have a look at it for you, but please try it out for yourself first.
Good luck
J
Re: Editing cart contents -- esp products with attributes
Hiya Justin,
Thanks for the reply! I got it sorted out, first by doing the "if false" but then I realized I wasn't understand the max items stuff in ZenCart properly. So I got rid of the max quantity limitation and reverted to an un-edited version of your script, and everything is looking good.
Thanks!
Re: Editing cart contents -- esp products with attributes
OK that is good news. I hope from now you can get on and make some money then ,..
Re: Editing cart contents -- esp products with attributes
Hi Justin,
Thank you for the reply, I know how busy you are and your time is greatly appreciated!
Yes, my site is empowermentsanctuary.com, but my store is located at empowermentsanctuary.com/marketplace.
Thanks for the tip on the attributes. None of the test products I've put in so far have any, hence the problem! I will be setting up attributes once I load the cart with actual products.
It seems I was just putting the cart before the horse in this case :)
Thanks again for the reassurance. If I have any issues or questions once I tweak a test product, I'll stop back by.
Re: Editing cart contents -- esp products with attributes
Hi Guys,
I tried this mod and have a problem that no one else has mentioned yet...
I added the [click to edit] code (and noticed that Justin's mod shows this as a div, v1.3.8a seems to have changed this to a span) and when I click on this when an item has attributes it seems to work, it shows a button that says "edit cart contents" but I could have sworn Justin's site said "Update Cart" which makes a lot more sense since I don't want to edit the cart contents at this point, I want to update the product and send that back to the cart...
Anyhow, I digress... when I change an attribute's value and click the edit cart button it dumps me to a blank page... If I hit the back button and return to my shopping cart everything is as it was before attempting to edit the attribute.
Does any one have any ideas?
Also, I noticed that the readme says: "Edit your existing includes/templates/TEMPLATE_NAME/templates/tpl_product_info_display.php file, to match the one included in the Product_Info_Display folder."
But v1.3.8a uses "YOUR_TEMPLATE" and not "TEMPLATE_NAME" but when I looked into the mods dir structure the was no reference to a dir named "TEMPLATE_NAME", It seems that the files are instead dumped into the "classic" folder. I tried to place those files in my template dir after getting the above error but it made no noticeable difference.
I have turned this mod off as this is a live cart, Any help would be greatly appreciated.
Gary777
Re: Editing cart contents -- esp products with attributes
Blank pages are caused by PHP errors, often a result of bad uploads or incorrect edits to files.
See the debug logging utility mentioned in this FAQ on the topic of blank pages: https://www.zen-cart.com/tutorials/index.php?article=82
Re: Editing cart contents -- esp products with attributes
Hi Gary
Sorry about the problems.
As Dr Byte mentions, blank pages are pretty hard to figure out if it is not your code, and you generally have to get a bit technical. But to me it sounds like your install has not gone well.
There may be differences between my original version and the patched version that Elkay put up, but that is probably not the cause of your problem.
I suggest you make sure that all the files from the mod you downloaded are present and in the right locations in your shop. If that is OK, then go back through each step of the read me and make sure you have followed the instructions to the letter.
If there is still no joy, completely remove the mod and start again.
Justin
PS I know it is a pain in the ########, but really you should have a copy of your zencart that you try things out on. It can be a local copy on your PC or just another install of Zencart on your webhost, that is not accessible to the general public. When you have tested out your mod or your changes , and they are working, then you upload them from there. Once your site has gone live, and you have customers, down time costs money.