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

Editing cart contents -- esp products with attributes

Views: 24,207

Results 161 to 166 of 166
29 Oct 2011, 2:28 PM
#161
corseter avatar

corseter

New Zenner

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

Editing cart contents -- esp products with attributes

I have managed to solve the issue myself. For anyone using Simple SEO all you have to do is put product_info in the exclude list in the configuration panel and the edit cart function works!!!:clap:

29 Oct 2011, 4:56 PM
#162
scriptjunkie avatar

scriptjunkie

Totally Zenned

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

Re: Editing cart contents -- esp products with attributes

corseter:

I have managed to solve the issue myself. For anyone using Simple SEO all you have to do is put product_info in the exclude list in the configuration panel and the edit cart function works!!!:clap:

Great! Thanks for coming back and sharing your resolution with the community! :smile:

*Go that extra mile, you never know what's at the end of the road

* Empowerment Sanctuary

11 Nov 2012, 4:46 PM
#163
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Editing cart contents -- esp products with attributes

Thanks for this plugin; I just installed this on my Zen Cart 1.5.1 store ... it works like a dream!

19 Dec 2012, 5:55 AM
#164
dw08gm avatar

dw08gm

Totally Zenned

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

Re: Editing cart contents -- esp products with attributes

In Edit_Cart_v2_For_ZCv150, tpl_product_info_display.php must be edited as follows (highlights in red):

// bof Edit_Cart 150 Justin - Part 1
// What follows is the old code. You need to replace or comment this section, and add the "Edit Cart" code just below it.
/*
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'), 'post', 'enctype="multipart/form-data"') . "\n";
*/

//This bit contributed by Damian Taylor, makes the SEO mod CEON URI work with "Edit Cart"
if($_SERVER['QUERY_STRING'][0] == ':') {
	$_GET['products_id'] = $_GET['products_id'] . $_SERVER['QUERY_STRING'];
}

//This bit looks at the product id param and if it is not a simple number like "121", but a big string like "52:96f247828566a562a4e8de1552a48c65" diverts form action to "Edit Cart"
if(is_numeric($_GET['products_id'])) {
	$cartAction="add_product";	
}else{
	$cartAction = "edit_product_in_cart";
}
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";
// eof Edit_Cart 150 Justin - Part 1

However in Edit_Cart 2.03, my tpl_product_info_display.php looks like this:

// bof Edit_Cart 2.03 Justin - Part 1
// What follows is the old code. You need to replace or comment this section, and add the "Edit Cart" code just below it.
/*
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'), 'post', 'enctype="multipart/form-data"') . "\n";
*/

//This bit contributed by Damian Taylor, makes the SEO mod CEON URI work with "Edit Cart"
if($_SERVER['QUERY_STRING'][0] == ':') {
	$_GET['products_id'] = $_GET['products_id'] . $_SERVER['QUERY_STRING'];
}

//This bit looks at the product id param and if it is not a simple number like "121", but a big string like "52:96f247828566a562a4e8de1552a48c65" diverts form action to "Edit Cart"
if(is_numeric($_GET['products_id'])) {
	$cartAction="add_product";
}else{
	$cartAction = "edit_product_in_cart";
}
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";
// eof Edit_Cart 2.03 Justin Part One

Question:
In Edit_Cart 150, should the line

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

be replaced 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";

Alternatively, should the preceding lines

if(is_numeric($_GET['products_id'])) {
	$cartAction="add_product";
}else{
	$cartAction = "edit_product_in_cart";
}

be replaced with (or something like)

if(is_numeric($_GET['products_id'])) {
	$cartAction="add_product, $request_type";
}else{
	$cartAction = "edit_product_in_cart";
}

Thanks in advance

6 May 2013, 6:04 PM
#165
floridagofishing avatar

floridagofishing

New Zenner

Join Date:
Oct 2012
Location:
Naples, FL
Posts:
30
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

Hi, I just installed this mod on my shop at http://tinyurl.com/bw2k2ee.
I sell mostly download items where you select the files to purchase and add to card. Click on the PDF file on the left, I am redoing all pages to be like this one, 1 item, 30 files to choose from.

When you edit the item in the cart it takes you to the product, I edit the options, click Add to Cart and then a 2nd items appears! Is this normal. I checked out a couple other stores and the same thing happens - it adds a new product, doesn't replace origion one you edited.

If this is normal I can live with it but it would be nice to remove the origional or replace it, not make 2 items.

6 May 2013, 6:31 PM
#166
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Editing cart contents -- esp products with attributes

FloridaGoFishing:

When you edit the item in the cart it takes you to the product, I edit the options, click Add to Cart and then a 2nd items appears! Is this normal.
Yes, that is normal. And isn't related to the mod. That's just how the application works.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.