Zen Cart Logo
Forums / All Other Contributions/Addons / Editing cart contents -- esp products with attributes

Editing cart contents -- esp products with attributes

Views: 24,165

Results 61 to 80 of 166
18 May 2008, 5:56 AM
#61
ssp711 avatar

ssp711

New Zenner

Join Date:
Aug 2006
Posts:
11
Plugin Contributions:
0

Editing cart contents -- esp products with attributes

hi,

I have tried this mod, and it is great.

However, there are some suggestion which may make it better:

  1. Is it possible to put a link in the cart page, which link "Edit Product Option" just besides the product name or else where.
    However, the link is NOT link back to the product page, it can be a popup page, and it only show the product option.
    so that buyer DO NOT need to go back to the product page and reload the whole page.

  2. if using the 1 suggestion, there is no need to worry about the SEO link problem.

  3. if using the 1 suggestion, there is NO need to modify the cored product info page, else well else the shopping cart tpl.
    it is supposed to add ONE line like this:
    <a href="update cart page url">Edit Product Option Here</a>

sorry that i don't know too much php, but i guess it is more easy for the future upgrade and modification.

hope Justin can take my suggestion in the new release.

18 May 2008, 9:21 AM
#62
justinhunt avatar

justinhunt

New Zenner

Join Date:
Sep 2007
Posts:
77
Plugin Contributions:
1

Re: Editing cart contents -- esp products with attributes

Thanks for the tip. I guess something like this could be done.

Personally i do not see a great deal of gain in it, because there is no real problem with how it works now. Admittedly though a separate page soley for editing option attributes, might be useful.

Thanks for the idea.

19 May 2008, 8:19 AM
#63
ssp711 avatar

ssp711

New Zenner

Join Date:
Aug 2006
Posts:
11
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

justinhunt:

Thanks for the tip. I guess something like this could be done.

Personally i do not see a great deal of gain in it, because there is no real problem with how it works now. Admittedly though a separate page soley for editing option attributes, might be useful.

Thanks for the idea.

hi,
I am not if other store have this problem.
but for my store, we are selling radio control toys.

many buyer will buy TWO same item, but with different option.

say, he may add product A with option 35Mhz to the cart.
later on, on the checkout page, he may want to buy another one.
normally, they will click on the item link in the shopping cart page.

in this case, they will add the SAME item, but with another option.

however, for the current edit cart, people click on the item link.
it will MODIFY the current item instead of ADD a NEW item.

another quick way is seperate the EDIT option link and Item link in the shopping cart page.

however, when i try to modify your code, it seems that you check user is click "from the cart page" in order to determinate it should be NEW item or modify item.

by the way, if i need the mod that i mention, i willing to pay for this.
can you write it for me?

19 May 2008, 1:37 PM
#64
justinhunt avatar

justinhunt

New Zenner

Join Date:
Sep 2007
Posts:
77
Plugin Contributions:
1

Re: Editing cart contents -- esp products with attributes

OK, I see the issue. If they click on the link in the shopping cart page, it shows them the edit options page for that cart item.

But you want them to be able to choose from the cart either
i) Edit the item
OR
ii) Add another of those items, (and be able to set a different set of options for it)
(Please correct me if I didn't get it)

You are right that the current mod, defaults to Edit Mode if the user clicks on the item title in the cart. To add an "Add another of these" button as well as the current "Edit options" link. It is not a very big job.

So small I do not think I would charge for doing it. But I am really busy and can't committ myself to providing decent support. Which is the other reason why I won't charge for it. (It is also the reason I haven't released any of my other mods. Is that bad?)

When do you need it by?

19 May 2008, 5:38 PM
#65
ssp711 avatar

ssp711

New Zenner

Join Date:
Aug 2006
Posts:
11
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

thanks for your quick response.

I think add a link in the cart page:

[Edit This item Option]

is good.

If buyer clikc on this link, then he is supposed to EDIT the current item which is in the cart.

If the buyer click on the item image or the name (that what the current zen cart do)
then he is suppose to add a NEW item, rather than UPDATE the product option.

Sorry that I don't want to force you to do that...
acutally, i just want to make some suggestion.

you are always welcome to do it if you are free.

i just want to get this mod quick as i really need it.

for the money, i just think that we can't give any support to all great programmer, like you.

you may treat it as donation rather than "real charge for me"

by the way, i really looking for the mod that i want, which is a seperate page to modify the product option.
as it can give much better shopping experience to the buyer when they edit the option.
they will clear to notice that they are EDIT the option, and won't be confuse.
also, for the upgrade, it is really much more easier, as i know many people already modified that prodcut info template.

again, all of the above is just my personal suggestion~~

^__________^

12 Jul 2008, 8:40 AM
#66
elkay avatar

elkay

New Zenner

Join Date:
Jul 2008
Posts:
4
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

hello there,

i have a problem with the edit_cart module:

  • clicking on a product (with attributes) the product page appear, with the "edit product" button

  • now, when you change an attribute, everything goes well, the product is updatet with the new attributes.
    but if i DONT change any of the attributes and click "edit product", the products gets deleted from cart.

i've been searching about 4 hours for the error, but can't find nor fix it ^^

can someone help me ?

lukas

12 Jul 2008, 10:14 AM
#67
elkay avatar

elkay

New Zenner

Join Date:
Jul 2008
Posts:
4
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

ok solved it on my own:

do the following changes in /includes/extra_cart_actions/edit_cart_item.php:

arround line 176:

  1. replace
     $_SESSION['cart']->add_cart($_POST['products_id'], $_SESSION['cart']->get_quantity(zen_get_uprid($_POST['products_id'], $real_ids)), $real_ids);

with

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);

arround line 210
2. replace

	  //remove the existing item
	  $_SESSION['cart']->remove($_POST['edit_item_id']);

with```
//remove the existing item
if ($_POST['edit_item_id'] != zen_get_uprid($_POST['products_id'], $real_ids))
$_SESSION['cart']->remove($_POST['edit_item_id']);


actually i didn't get the exact logic behind it, but it should work :)

cheers, 
lukas
15 Jul 2008, 11:09 PM
#68
justinhunt avatar

justinhunt

New Zenner

Join Date:
Sep 2007
Posts:
77
Plugin Contributions:
1

Re: Editing cart contents -- esp products with attributes

Thanks Lukas

Actually I could not reproduce that error myself, but hope to be able to have a another crack at it soon. In the meantime thanks for posting the code. It is a big help.

Justin

12 Aug 2008, 8:30 AM
#69
jonton26 avatar

jonton26

New Zenner

Join Date:
Jul 2008
Posts:
9
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

Hi there Justin and everyone else

i've installed this on a shop running with Price by Attribute...
Ok everything is installed nicely, but when i get back to my cart it still adds a new product on top of the edited product...
I uploaded everything for sure. But the edit button just seems to work like the old Add to Cart button!

https://www.bluedclothing.com/shop/
shop needs to be delivered soon... :-(

Thanks in advance for any help provided.

Jonathan

12 Aug 2008, 9:15 AM
#70
elkay avatar

elkay

New Zenner

Join Date:
Jul 2008
Posts:
4
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

Hi Jonathan,

please post lines 175-177 and 209-211 of your /includes/extra_cart_actions/edit_cart_item.php.
to see if the relevant changes were made...

Lukas

13 Aug 2008, 7:59 AM
#71
jonton26 avatar

jonton26

New Zenner

Join Date:
Jul 2008
Posts:
9
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

Hi Elkay

Here goes...

          //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

      }
	  //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

22 Aug 2008, 3:17 AM
#72
justinhunt avatar

justinhunt

New Zenner

Join Date:
Sep 2007
Posts:
77
Plugin Contributions:
1

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

22 Aug 2008, 3:34 AM
#73
justinhunt avatar

justinhunt

New Zenner

Join Date:
Sep 2007
Posts:
77
Plugin Contributions:
1

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

  1. 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

22 Aug 2008, 8:11 PM
#74
jonton26 avatar

jonton26

New Zenner

Join Date:
Jul 2008
Posts:
9
Plugin Contributions:
0

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

22 Aug 2008, 8:20 PM
#75
jonton26 avatar

jonton26

New Zenner

Join Date:
Jul 2008
Posts:
9
Plugin Contributions:
0

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

22 Aug 2008, 8:41 PM
#76
jonton26 avatar

jonton26

New Zenner

Join Date:
Jul 2008
Posts:
9
Plugin Contributions:
0

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

24 Aug 2008, 10:18 AM
#77
justinhunt avatar

justinhunt

New Zenner

Join Date:
Sep 2007
Posts:
77
Plugin Contributions:
1

Re: Editing cart contents -- esp products with attributes

Great that is good news. Hope the client is happy.

Justin

5 Sep 2008, 3:16 PM
#78
pasmith avatar

pasmith

New Zenner

Join Date:
Aug 2008
Posts:
9
Plugin Contributions:
0

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:

<form name="cart_quantity" action="http://marketingservices.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?

5 Sep 2008, 4:01 PM
#79
pasmith avatar

pasmith

New Zenner

Join Date:
Aug 2008
Posts:
9
Plugin Contributions:
0

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:

   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

$_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?

9 Sep 2008, 9:01 PM
#80
pasmith avatar

pasmith

New Zenner

Join Date:
Aug 2008
Posts:
9
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

No one has any ideas, I guess?