Re: Editing cart contents -- esp products with attributes
Hi Elkay
Here goes...
PHP Code:
//edited in version 1-2 by elkay on 12.07.2008
if ($_POST['edit_item_id'] != zen_get_uprid($_POST['products_id'], $real_ids))
$_SESSION['cart']->add_cart($_POST['products_id'], $_SESSION['cart']->get_quantity(zen_get_uprid($_POST['products_id'], $real_ids))+($new_qty), $real_ids);
else
$_SESSION['cart']->add_cart($_POST['products_id'], $_SESSION['cart']->get_quantity(zen_get_uprid($_POST['products_id'], $real_ids)), $real_ids);
//edit elkay end
and
PHP Code:
}
//remove the existing item
/*line added by elkay with v1-2 on 12.07.2008*/ if ($_POST['edit_item_id'] != zen_get_uprid($_POST['products_id'], $real_ids))
$_SESSION['cart']->remove($_POST['edit_item_id']);
//head off to our destination
Everything seems fine...so I don't get it...
I took the link "edit cart" off , but i'll put it back on so u can try it
http://www.bluedclothing.com/shop/
my products are priced by attributes...u have different sizes (S, L, M, XL) for which u can enter any quantity - it multiplies the total price.
Anyway, whenever u change any attribute (even color...or whatever), it still leaves an extra product in the cart and doesn't perform the actual delete there.
Thanks for the help!
Jonathan
Re: Editing cart contents -- esp products with attributes
Hi Jonathon and Lukas
First up thanks for your bug fixes Lukas. I was a bit suprised to see someone else chipping in (since I kind of haven't been!) . But it was a nice surprise. Our primary shop is almost a full time job these days, which is great, but bloody tiring, since I already have a fulltime job. So I just don't have time to look at this stuff very often now.
Jonathon are you running any other non standard mods, in particular any SEO mods that modify your urls?
Justin
Re: Editing cart contents -- esp products with attributes
I had a quick peek at your site Jonathon.
The problem is with your productinfo page. It is not reading the url properly and so is showing the add button, not the edit button. Are you sure that the edit_cart module was installed properly?
I would check that you have changed the code in the product info page as per the instructions. It appears that you may not have.
Quoting step 4 from the read me
Quote:
4. 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.
There are two sections to edit:
i) between <!--bof Form start--> and <!--bof Form end-->
and
ii) just after <!--bof Add to Cart Box -->
The places to edit are all commented. If you search for "Edit_Cart" you will see them.
Justin
Re: Editing cart contents -- esp products with attributes
Hi Justin
Good to hear from you!
I had to disable it on the site, but what i'll do is re-install your mod,
Other thing, my client wants the button to still say "add to cart" instead of "edit cart" when editing a product, so I'll have to change this myself (not a prob on my end)...so if you retest my site, you will see that button say "Add to Cart" k?
Thanks for the support!
Spk soon
J
Re: Editing cart contents -- esp products with attributes
Hey
When i go to tthe download page for your mod, it says v.1.2
However when I open it, the files all say v1.1
Can u double check that??
Thanks
Jonathan
Re: Editing cart contents -- esp products with attributes
I re-uploaded things, I worked making sure the code is inserted properly, and well, all i can say is IT WORKS!!! Yay!
Must have done somethn wrong...before.
Oh I had to comment lines that had to do with a module called "Attribute Grid" (I wasn't using the mod anyway) which weren't disabled first time I installed "edit cart" ...could be what caused me problems first time...
Ok thanks for this great mod!
Client will be HAPPY!
Cheers
Jonathan
Re: Editing cart contents -- esp products with attributes
Great that is good news. Hope the client is happy.
Justin
Re: Editing cart contents -- esp products with attributes
Hello everyone,
I'm having some trouble with this mod. I add a product (with attributes) to the cart, I think click the name to go to the edit screen. I edit that attributes, and the button says Update the cart.
But when I click it, I go to a "Your Shopping Cart is Empty" page. I guess the mod is deleting the old product but not creating the new one?
The Form tag on the edit page reads like this:
Code:
<form name="cart_quantity" action="http://########################vices.ehpub.com/store/index.php?main_page=product_info&products_id=6%3A63e472cb4f0c2a3123aacb2a14cb943e&number_of_uploads=2&action=edit_product_in_cart" method="post" enctype="multipart/form-data">
Unfortunately the store is still in development and not on a public server, so I can't show it working. :(
Any idea what could be wrong? This is the first mod I've applied to Zen cart and I'm a new user so I wonder if I borked the install?
Re: Editing cart contents -- esp products with attributes
OK a little more info...
It looks like I'm getting a TRUE at this if statement:
Code:
if ((zen_get_products_quantity_order_max($_POST['products_id']) == 1 and $_SESSION['cart']->in_cart_mixed($_POST['products_id']) == 1)) {
Which is preventing any actual editing of the attributes.
Then at the end of the edit_product_in_cart routine
Code:
$_SESSION['cart']->remove($_POST['edit_item_id']);
Is removing the existing item.
So this is looking like a problem with the way I have my items set up.
I have Product Qty Maximum: 1 in the Product Set up page because I want the Qty Box suppressed (and attributes are required, so it makes no sense to but a quantity of more than one).
Am I handling this wrong?
Re: Editing cart contents -- esp products with attributes
No one has any ideas, I guess?