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 101 to 120 of 166
23 Nov 2008, 3:08 AM
#101
luvingmamma avatar

luvingmamma

New Zenner

Join Date:
Aug 2007
Location:
Troy, MI
Posts:
80
Plugin Contributions:
0

Editing cart contents -- esp products with attributes

I cannot get this to work on my site and the debugging tool does not show any errors on this mod's effected forms (I have 2 errors that are related to the reward pointe suite mod that I can't figure out but still working on that)

it also took my buttons away on my cart and no matter what I do it won't add them back on :(

https://www.luvingmammadiapers.com

Thanks!

23 Nov 2008, 1:21 PM
#102
justinhunt avatar

justinhunt

New Zenner

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

Re: Editing cart contents -- esp products with attributes

Hi luvingmamma

I had a little look over your site. Sorry, I didn't buy anything.:cry:

First up, the missing buttons look like they have had their constant declarations altered/deleted or moved somehow. The Edit_Cart mod itself, wouldn't do anything like that. But when you installed it, or another mod, you might have inadvertently done something.

Go to your websites admin -> tools -> developers tool kit. Then search for UZC_BUTTON_CHECKOUT_ALT . This constant is not being resolved to the proper text, and neither is the constant that contains the URL of the button. So there is a problem somewhere around those declarations I would say.

It pays when you install a mod, to open up a few pages on your site, and see if everything looks OK. After you have installed a few mods, it can be unclear what caused things to go wrong.

Secondly you appear to have some sort of S.E.O mod installed that changes the URL zencart uses from something like this:

/index.php?main_page=product_info&products_id=17

to something like this:

/diaper-diva-onesie-p-377.html?number_of_uploads=0

That appears to be messing with the Edit Cart mod, because it send the user from their shopping cart back to a URL of the first type. That is why you get a page not found situation. It is certainly fixable, but I would need to know what S.E.O mod you were using, and would need time to fix it. I don't really have the time. But let me know and I will try and look at it.

Good luck. The less nappy rash there is in the world, the happier we will all be, so I for one hope we can get this problem solved.

J

23 Nov 2008, 4:45 PM
#103
luvingmamma avatar

luvingmamma

New Zenner

Join Date:
Aug 2007
Location:
Troy, MI
Posts:
80
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

I am going to try this stuff later this afternoon when I am able to get my kids busy lol :)

I have not installed any SEO mod however I had a web designer who just installed anything he wanted so I will try to look through the files and see what I can find as far as mod files and see if I can point it out. I am assuming there would be no mention of it in the admin section menu's???

I typically only install mods that increase customer service abilities or tracking :( but the guy who originally built my first cart (he was not as educated as he liked me to think so we had to have a 2nd built :() used to do stuff and just send it over.

I appreciate your help and will update you with my results shortly :)

23 Nov 2008, 6:23 PM
#104
luvingmamma avatar

luvingmamma

New Zenner

Join Date:
Aug 2007
Location:
Troy, MI
Posts:
80
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

OK I found that error- it's line 125 of my tpl_shopping_cart_defined.php

Off to examine the code there :) thank you! I always forget about that tool i need to burn it in my brain :)

24 Nov 2008, 1:56 PM
#105
justinhunt avatar

justinhunt

New Zenner

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

Re: Editing cart contents -- esp products with attributes

OK. Let me know how you get on.

There might be something in the Admin section to let you know what mod the S.E.O one is. Have a look in admin->extras because I know the "Simple SEO URL " mod puts a menu item there. If you can turn it off on the menu try that and see what happens.

Justin

15 Feb 2009, 1:41 PM
#106
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

Thanks for the mod. However (of course!), I notice no change on my site...everything works as the standard ZC, no different button, no error, simply no difference.

I changed the Classic folder to Custom and copied the parts of your tpl_product_info_display.php into mine (replacing whatever was there before). It seemed as simple as that...did I miss something? I don't see anything else like this in the thread.

Cheers,

Robbie

15 Feb 2009, 2:08 PM
#107
justinhunt avatar

justinhunt

New Zenner

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

Re: Editing cart contents -- esp products with attributes

Hey Robbie

It is pretty much as simple as that, yes. Basically you should go back make sure you have followed the instructions when you installed it.
If that seems ok then:

First make sure that it really is not working. You won't notice any changes if you are testing on a product with no attributes. Test on one which has attributes.
Second, make sure you have made the changes in the correct template.
Third, look at every file in the download and manually confirm that file is present on your site and in the right location.

If you give me the URL of your site, providing it is online, I can have a look at it. But I think if you give it a good once over you will find the problem.

Justin
IMHO Personally I find 2 hours of bleary bug fixing in the small hours, less effective than 20 mins of calm, methodical problem solving the next day. That is my general advice to all zen carters reading this thread, not just you.

15 Feb 2009, 3:05 PM
#108
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

Now it works!

I did it twice last night and now I tried again...maybe a cache issue (even though I refreshed)? Because I did try with attributes. Regardless, thanks!

R

15 Feb 2009, 9:39 PM
#109
justinhunt avatar

justinhunt

New Zenner

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

Re: Editing cart contents -- esp products with attributes

OK thats cool. Glad it worked.

J

22 Feb 2009, 7:42 PM
#110
jimmyx avatar

jimmyx

New Zenner

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

Re: Editing cart contents -- esp products with attributes

I may be a n00b and all but I am following your instructions and it states:

  1. Edit your existing includes/templates/TEMPLATE_NAME/templates/tpl_product_info_display.php file,

I cannot find this file anywhere in my template folders... I am using the classic template... any ideas ?

22 Feb 2009, 8:22 PM
#111
jimmyx avatar

jimmyx

New Zenner

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

Re: Editing cart contents -- esp products with attributes

Also when one does find the appropriate file do I REPLACE lines in the tpl_product_info_display.php or do i ADD them?

Please help the n00bs :blush:

22 Feb 2009, 9:57 PM
#112
justinhunt avatar

justinhunt

New Zenner

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

Re: Editing cart contents -- esp products with attributes

Hi JimmyX

If you can't find that file, then the template that you are using doesn't override the core template file of the same name. In that case it is safe just to copy the tpl_product_info_display.php from the editcart mod into your includes/templates/TEMPLATE_NAME/templates folder.

You might later want a better template than the classic one, and that will almost certainly have a customised tpl_product_info_display.php.
In that case you have to manually open up that file and add my changes to your file. That will mean commenting some lines and adding some other lines. It sounds scarey, but if you make a copy of your original file first, it is pretty safe and not too hard.

Good luck

22 Feb 2009, 11:00 PM
#113
jimmyx avatar

jimmyx

New Zenner

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

Re: Editing cart contents -- esp products with attributes

ok well i am not scared to edit the php file... but i just am not sure what to comment out and what exactly to add.

like ive found the commented parts i am supposed to add to my existing php file... but do i just add these lines just anywhere in between <!--bof Form start--> and <!--bof Form end-->

basically i need to know EXACTLY what I should do, what i should comment out what i should replace what i should add.

24 Feb 2009, 2:39 PM
#114
justinhunt avatar

justinhunt

New Zenner

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

Re: Editing cart contents -- esp products with attributes

Sorry for the slow reply, JimmyX. I hope you already got it going, if not ...

You really just need to open up the tpl_product_info_display.php file and have a look at it. Because the changes you need to make are all commented on in there. Basically open up your tpl_product_info_display.php and open the editcart tpl_product_info_display.php and compare them as instructed in the read me.

Anyway, here is a step by step guide:

Comment out (or delete) the lines between

<!--bof Form start--> and <!--bof Form end-->

in your file.
Then in place of them, ie between the bof Form tags, add the code from my file. So it will look like :

<!--bof Form start-->
//add Justin Edit_Cart Mod 20080224

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

//end of add Justin Edit_Cart Mod 20080224

?>
<!--bof Form end-->

Then go a little further down the file, and find this line

if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {

Comment (or delete) that line and all subsequent lines until , but NOT including the next

} else {

Then just above that , [add these lines

            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1 or (! is_numeric($_GET['products_id'])) ) {



					//Edit Justin replaced the $the_button with a new def. that supports editing,  20071120

					//if the item being displayed was referred here from the cart, we are in edit mode  					

					if (! is_numeric($_GET['products_id'])){

						//establish	quantity of product in cart

						$existing_quantity=$_SESSION['cart']->get_quantity($_GET['products_id']);

						

						//make the edit button

						$the_button = '<input type="hidden" name="cart_quantity" value="' . $existing_quantity . '" />' . 

									zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . 

									zen_draw_hidden_field('edit_item_id', $_GET['products_id']) . 

									zen_image_submit(BUTTON_IMAGE_EDIT_CART_CONTENTS, BUTTON_IMAGE_EDIT_CART_CONTENTS_ALT);

					

					//If we were not referred from cart, we are not in edit mode

					}else{

							

				              // hide the quantity box and default to 1

				              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . 

							  zen_draw_hidden_field('products_id', (int)$_GET['products_id']) .

							  zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);

					}

And you are all done! I hope it is helpful.

Justin

24 Feb 2009, 4:27 PM
#115
jimmyx avatar

jimmyx

New Zenner

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

Re: Editing cart contents -- esp products with attributes

Thank you for this very detailed information... I think my tpl_product_info_display.php has been edited by the other mods ive installed:

Fast and Easy checkout 1.28
Easy Signup / Login 1.20
GoogleSitemapAdmin
graphical_sales_report_v1-02
monthly_sales_and_tax_summary_report_1-3
save_for_later_1-0
social_bookmarking_addtobookmarks_1-2

anyways here is my tpl_product_info_display.php:

<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=product_info.<br />
 * Displays details of a typical product
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_product_info_display.php 5369 2006-12-23 10:55:52Z drbyte $
 */
 //require(DIR_WS_MODULES . '/debug_blocks/product_info_prices.php');
?>
<div class="centerColumn" id="productGeneral">

<!--bof Form start-->
<?php 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"; ?>
<!--eof Form start-->

<?php if ($messageStack->size('product_info') > 0) echo $messageStack->output('product_info'); ?>

<!--bof Category Icon -->
<?php if ($module_show_categories != 0) {?>
<?php
/**
 * display the category icons
 */
require($template->get_template_dir('/tpl_modules_category_icon_display.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_icon_display.php'); ?>
<?php } ?>
<!--eof Category Icon -->

<!--bof Prev/Next top position -->
<?php if (PRODUCT_INFO_PREVIOUS_NEXT == 1 or PRODUCT_INFO_PREVIOUS_NEXT == 3) { ?>
<?php
/**
 * display the product previous/next helper
 */
require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?>
<?php } ?>
<!--eof Prev/Next top position-->

As you can see there is no <!--bof Form end--> or if there is i am blind and cannot see it at the top...

24 Feb 2009, 10:15 PM
#116
justinhunt avatar

justinhunt

New Zenner

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

Re: Editing cart contents -- esp products with attributes

Oooops, sorry those enclosing tags should be

<!--bof Form start--> <!--eof Form start-->

Justin

24 Feb 2009, 11:26 PM
#117
jimmyx avatar

jimmyx

New Zenner

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

Re: Editing cart contents -- esp products with attributes

ahh so id remove:

<!--bof Form start-->

------------------------THIS LINE--------------------------------------

<?php 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 LINE--------------------------------------

<!--eof Form start-->
25 Feb 2009, 5:30 AM
#118
justinhunt avatar

justinhunt

New Zenner

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

Re: Editing cart contents -- esp products with attributes

Yes.

Get stuck into it JimmyX, and just make the changes. It'll work.

J

25 Feb 2009, 2:35 PM
#119
jimmyx avatar

jimmyx

New Zenner

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

Re: Editing cart contents -- esp products with attributes

Well I will now, since the readme and all the info I was looking at kept telling me to look for <!--bof Form end--> and i could not find this... I wasnt about to start editing things.

Now I know i was looking for <!--eof Form start--> I am all set and I will proceed with the mod install.

Thank you for all your help, it is much appreciated.

I hope all this information can help others as well.

5 Mar 2009, 3:41 PM
#120
dasha avatar

dasha

New Zenner

Join Date:
Mar 2008
Location:
Nashville, TN
Posts:
21
Plugin Contributions:
0

Re: Editing cart contents -- esp products with attributes

Hey There -
So i've read through these threads and have seen that a lot of people seem to be having a similar problem that I am having but I didn't notice it getting resolved. Does anyone know if there is a solution to get edit cart to work with SEO URL optimized sites that have products with many attributes? I can get the SEO URL to work on every page except the ones that use the click to edit. Any help would be greatly appreciated. Thanks!

Dasha