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 141 to 160 of 166
2 Mar 2010, 2:11 AM
#141
justinhunt avatar

justinhunt

New Zenner

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

Editing cart contents -- esp products with attributes

Thanks for your comment, DVDTitan.

Yes, that is something that we could improve. Currently you have to go back to the product listing, and select the product again.

Do you think a link beneath the item in the cart, that says something like, [Choose another] would be what you are after?

Justin

2 Mar 2010, 6:47 AM
#142
dvdtitan avatar

dvdtitan

New Zenner

Join Date:
Apr 2007
Posts:
87
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

Hi Justin

Thanks for the reply. Yes your idea would be perfect.

Whilst the edit cart function in its current state removes the hassle of editing an item in the cart it creates an issue in adding different variations of the same product to a customers order.

An add to cart underneath the edit button would solve this.

Thanks once again.

9 Apr 2010, 8:14 PM
#143
mkopecky avatar

mkopecky

New Zenner

Join Date:
Aug 2007
Posts:
31
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

damiantaylor:

Oh, and if anybody like the 'click to edit' text but only wants it to appear if the item has attributes, change the following line in tpl_shopping_cart_default.php from:

<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<br />[click to edit]' . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>

to:

<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle">

<?php echo $product['productsName']; if(!empty($product['attributes'])) { echo '<br />[click to edit]'; } echo '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>

I have the model number in my string of original code and am not sure how to incorporate the attribute addition into the code. I do not know code well and each time I try to include the newest snippet of code into my code, the shopping cart disappears and I receive a blank page.

Can you tell me how I should modify the code?

My string of code is below:
<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle" style="color: rgb(0, 0, 255)">

<?php echo $product['productsName'] . ' ' . zen_products_lookup($product['id'], 'products_model') . '<br />[Click to Personalize]' . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>

Thanks,
Mkopecky

20 May 2010, 8:06 PM
#144
amandagero avatar

amandagero

Zen Follower

Join Date:
Feb 2009
Posts:
188
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

has anybody gotten this to work with 1.3.9?

i have tried and everytime you edit the cart it just keeps adding more products. i took the mod out but if someone could test it and maybe let me know how to get it to work that would be great.

26 May 2010, 11:13 AM
#145
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Editing cart contents -- esp products with attributes

In edit_cart_v1.3 (good for v138a), the two main files to edit are
/includes/templates/template_default/templates/tpl_product_info_display.php
/includes/templates/template_default/templates/tpl_shopping_cart_default.php

In
/includes/templates/template_default/templates/tpl_product_info_display.php
Line 19 of v139c is now
echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product', $request_type), 'post', 'enctype="multipart/form-data"') . "\n";

Incorporating edit_cart_v1.3, this line is replaced by

echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=' . $cartAction), 'post', 'enctype="multipart/form-data"') . "\n";

However in
/includes/templates/template_default/templates/tpl_shopping_cart_default.php
Line 33 of v139c is now

<?php echo zen_draw_form('cart_quantity', zen_href_link(FILENAME_SHOPPING_CART, 'action=update_product', $request_type)); ?>

My question is: should there also be a $request_type, or something similar, in tpl_product_info_display.php, or has 139c tpl_shopping_cart_default.php taken care of this.

26 May 2010, 9:19 PM
#146
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Editing cart contents -- esp products with attributes

Using the $request_type is just a good way to avoid any issues with submits on a page that might be SSL based on moving between the secure pages and non-secure pages ...

Most places where this occurs have been addressed ... there are still a few others that we will catch over time ...

27 May 2010, 4:48 AM
#147
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Editing cart contents -- esp products with attributes

Ajeh:

Using the $request_type is just a good way to avoid any issues with submits on a page that might be SSL based on moving between the secure pages and non-secure pages ...

Most places where this occurs have been addressed ... there are still a few others that we will catch over time ...

Hi Ajeh

Is this one instance yet to be resolved or of no great consequence.

TIA

27 May 2010, 4:20 PM
#148
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Editing cart contents -- esp products with attributes

I would add it for the products _info page as people do login from there then want to Add a Product to the cart if they return and are on secure or do a search or look at products by manufacturers etc.

28 May 2010, 2:44 PM
#149
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Editing cart contents -- esp products with attributes

Hi Ajeh

In Line 19 of the modified
/includes/templates/template_default/templates/tpl_product_info_display.php
is it OK to add , $request_type immediately after $cartAction, as with

echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=' . $cartAction, $request_type), 'post', 'enctype="multipart/form-data"') . "\n"; 

or should $request_type go elsewhere in this line?

TIA

28 May 2010, 3:25 PM
#150
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Editing cart contents -- esp products with attributes

It should work ...

Have you tried it? :smile:

28 May 2010, 4:03 PM
#151
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Editing cart contents -- esp products with attributes

Hi Ajeh

I have not yet done so but will tomorrow. Its 2am here atm.

Generally I try to get an understanding of what something does before committing to it, but I am still very much on the J curve with ZC, and have yet to fully fathom the placement of code.

Thanks for your feedback and guidance.

6 Sep 2010, 7:15 PM
#152
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Location:
SF Bay Area
Posts:
837
Plugin Contributions:
1

Re: Editing cart contents -- esp products with attributes

If a customer does not choose any options when adding an item to the cart, the the id is numeric so the option to edit the item in the cart is not offered. However, the customer may want to go back and select an option.

I've messed around a bit with this and haven't found a way to offer the chance to go back and add options if none were chosen initially.

Is there a way around this?

Note: forcing one option to be selected initially works, but is not appropriate in this case.

Thanks!

14 Sep 2010, 1:49 PM
#153
alexsmith2709 avatar

alexsmith2709

New Zenner

Join Date:
May 2010
Posts:
36
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

I i installed this mod, but whether it was me or the mod i found that the product image was being displayed twice and so was the product title link.
I have fixed this by editing the following code in tpl_shopping_cart_default.php around line 85.

//================================Start of Edit_Cart mod Justin =================================================================
<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
//===============================================================================================================================
<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle">
<?php echo $product['productsName'];
if(!empty($product['attributes'])) {
echo '<br />[click to edit]';
}
echo '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a> 
//================================End Edit_Cart mod Justin =================================================================

That is the code according to the mod, but i changed to the following and now things work fine:

       <a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartProdTitle">
<?php
if(!empty($product['attributes'])) {
echo '<br />[click to edit]';
}
echo '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>

Justin if you still read this it maybe worth modifying your files with this edit if you wish to.

1 May 2011, 12:14 AM
#154
novastar avatar

novastar

Zen Follower

Join Date:
Jul 2009
Posts:
127
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

I think I've seen this on another store but is there a way to make the image in the shopping cart link to a new version of the item (as the cart is un-modded) and add a link that would edit the item in the cart, ideally reading "Edit Item"?

14 May 2011, 7:22 PM
#155
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Editing cart contents -- esp products with attributes

Hi all

Lines 117-155 in tpl_product_info_display provides for two button options, namely
BUTTON_IMAGE_EDIT_CART_CONTENTS
BUTTON_IMAGE_IN_CART

but where the latter button is defined exactly the same as
BUTTON_ADD_TO_CART

which makes me wonder Why?

However, upon changing the define of BUTTON_IMAGE_IN_CART to something like "Add another to cart", I find the revised button does not load no matter what I do, which also makes me wonder Why?

I made this change thinking that BUTTON_IMAGE_IN_CART would have been called after editing/updating a product in cart and then pressing the "Continue Shopping" button, but where "Continue Shopping" is in effect a glorified "Back" button.

So the reason for this post is to discover whether anyone else has made such a change to BUTTON_IMAGE_IN_CART and has got their changed button to load and under what circumstance(s).

Thanks in advance.

ps ScriptJunkie - Thanks for your prompt reply regarding this matter in another thread.

pps otherwise Edit_Cart1.3 works fine for me in 139h.

4 Jun 2011, 4:20 AM
#156
kamelion0927 avatar

kamelion0927

Zen Follower

Join Date:
Dec 2009
Posts:
208
Plugin Contributions:
1

Re: Editing cart contents -- esp products with attributes

Fabulous mod! It's working just as it should but I've got one nit-picky question.

Is there anyway to display the "Quantity in Cart" on products that have attributes, are in the cart and NOT being edited?

I've looked on a couple of different sites with this mod installed but it isn't showing on any of those sites either.

I've adjusted the code on tpl_product_info_display.php in my custom folder to read:

<div id="cartAdd">
  <?php if ($display_qty != '' and ($products_qty_box_status == 0 or $products_quantity_order_max == 1)) { 
      echo $display_qty;
	  }
      elseif ($display_qty != '' and ($products_qty_box_status != 0 or $products_quantity_order_max != 1)){ 
      echo $display_qty;
	  echo $display_button;
	  }
	  else {
	  echo $display_button;
	  }
   ?>
   </div>

The $display_qty will show on products that meet the first "if" statement criteria (and don't have attributes), but I get nothing on products with attributes that are in the cart. :frusty:

I would really appreciate any guidance anyone can provide.

Thanks in advance (and sorry for all the abandoned carts Justin).

4 Jun 2011, 4:43 AM
#157
kamelion0927 avatar

kamelion0927

Zen Follower

Join Date:
Dec 2009
Posts:
208
Plugin Contributions:
1

Re: Editing cart contents -- esp products with attributes

Sorry - I've been looking at the code that I've been working on all day and I just realized the reason that it's not displaying "Quantity in Cart" has nothing to do with the "Add to Cart" code - it's because for some reason products that are in the cart that have attributes are not being recognized by tpl_product_info_display.php as such unless you're in "edit mode" (ie the "edit cart contents" button is showing).

Could this do with the edits to tpl_shopping_cart_default?

Hmmm....

10 Jul 2011, 10:08 PM
#158
kidsstuff avatar

kidsstuff

New Zenner

Join Date:
Oct 2010
Posts:
44
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

justinhunt:

I updated the edit cart mod about 2 weeks ago, but it took a while to be approved by the zen cart team.

This change is basically to add support for Ceon URI mapping (thanks Damian), and a tidy up of the documentation.

Edit Cart is now known to support two SEO mods:
Ceon URI mapping and Ultimate SEO

Justin

Hi,
I am using Ultimate SEO urls and the attributes string is still being appended to the urls like http: //mysite.product-name:attributesstring.html for items with attributes in the shopping cart.
Has anyone got a solution for this?

8 Oct 2011, 7:07 AM
#159
sabastina avatar

sabastina

New Zenner

Join Date:
Nov 2005
Posts:
72
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

I just wanted to report that I have installed this mod on my ZC v1.3.9h and it DOES work...it works absolutely beautifully!!!

I did have an issue where I had to delete the commented section from the beginning of the code (the part where Justin begins =====) additionally, for some reason I had 3 instances of the code to add the edit text on the page. I simply removed the upper and lower code and left the middle code there.

I am not sure if these issues were my fault or not, but I figured I'd mention them here just incase someone else makes the same errors I did.

Thanks very much for this feature justin as my site relies very much on attributes and customers are very likely to change some of them before completing their orders.
:clap:WONDERFUL MOD!!!:clap:

28 Oct 2011, 10:06 PM
#160
corseter avatar

corseter

New Zenner

Join Date:
Jun 2010
Location:
Crossmolina, Ireland
Posts:
55
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

Has anyone been able to get this to work with Simple SEO? I have noticed that when you delete something from the cart it gives you the long code - http://corset.ie/zen/shopping_cart/product_id/437:dbbd22d935b7f9ea9cb3b62b1c15e04a - but still is unable to adjust it useing this mod. Shame, would really love it to work.:(