-
Re: 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 :(
www.luvingmammadiapers.com
Thanks!
-
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:
Code:
/index.php?main_page=product_info&products_id=17
to something like this:
Code:
/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
-
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 :)
-
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 :)
-
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
-
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
-
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.
-
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
-
Re: Editing cart contents -- esp products with attributes
OK thats cool. Glad it worked.
J
-
Re: Editing cart contents -- esp products with attributes
I may be a n00b and all but I am following your instructions and it states:
4. 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 ?
-
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:
-
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
-
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.
-
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 :
Code:
<!--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
Code:
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
Then just above that , [add these lines
Code:
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
-
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 Code:
<?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...
-
Re: Editing cart contents -- esp products with attributes
Oooops, sorry those enclosing tags should be
<!--bof Form start-->
<!--eof Form start-->
Justin
-
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-->
-
Re: Editing cart contents -- esp products with attributes
Yes.
Get stuck into it JimmyX, and just make the changes. It'll work.
J
-
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.
-
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
-
Re: Editing cart contents -- esp products with attributes
HI Dasha
What is the URL of your site, and which SEO mod are you using?
There has been talk about this problem, but I have never really had a good look at it.
-
Re: Editing cart contents -- esp products with attributes
Hey Justin -
Thanks for looking into this for me. The website is http://www.planet3press.com
We are using Simple SEO URL with the latest version of edit cart.
Thanks for your help!
Dasha:smile:
-
Re: Editing cart contents -- esp products with attributes
Hi Dasha
I had a look at your site (very nice, wow.) I tried selecting a product(Brochures - 8.5 x 14)and setting some attributes. Added it to my cart and then was able to edit it fine.
Do you have Simple SEO installed right now?
-
Re: Editing cart contents -- esp products with attributes
Justin-
Thanks for the compliment on the site :)
Sorry i should have clarified. Our site is live so I had to disable the product pages from being in the SEO Optimised URL's because of this issue... sorry that doesn't offer much help. :(
let me know if you need anything else from me. I'm trying to install it on our test server so I can play around with it with the SEO issue.
Dasha
-
Re: Editing cart contents -- esp products with attributes
Hi Dasha
I had a wee look at it, and the news is not good.
It appears that Simple SEO when it tidies up and reformats the URLs. tosses away the information about the previously chosen attributes when it makes the links.
I played around with it. When you put an item in your cart with attributes chosen and then click on the product link in the shopping cart, you are taken to the product info page with all the defaults selected. The attributes you chose are not selected. This means that using such a link with edit cart is meaningless, since the customer would have to reset all their attribute values from scratch again.
The unaltered zencart, shows the options the user selected when they return to the product page from the product link in the shopping cart.
If you tinker with it, I think you will see what I mean. To fix this up you would need to change the way Simple SEO works. Probably not trivial.
If I am wrong please let me know.
Justin
-
Re: Editing cart contents -- esp products with attributes
Actually, I just went off and did something else (put down the futons) and then I realized there is a way.
If you alter the link used in the tpl_shopping_cart_default.php template file so that it doesn't go through the Simple SEO mod, then it will work. That will probably mean hacking the /includes/modules/pages/shopping_cart/header_php.php file, though it might be possible to duplicate the default link making function for product info pages into your template file.
If you follow what I am saying then maybe you can make those changes yourself. If not, I can probably do it for you. But we would probably need to have a discussion via PM about it.
Justin
-
Re: Editing cart contents -- esp products with attributes
How do we create a link (programmically) that does not get processed by the SSU module? Is there a special call to zen_href_link we can make?
-
Re: Editing cart contents -- esp products with attributes
Justin - Flipside (who just responded before me) is working with us on this issue. Thanks so much for all your help!!
Dasha
-
Re: Editing cart contents -- esp products with attributes
SSU takes over the zen_href_link functionality, so you will either need to:
i) find out where SSU does that, and add a hook of some sort, that calls from the shopping cart can make use of to avoid being SSU'd.
or
ii) create a copy of the original zen_href_link function or logic, call it say zen_href_link_nossu, and call that instead from the shopping cart.
They would be the approaches I would look at. To me ii) looks better because you would be able to update SSU in the future without breaking your code. And it might be easier, thout\g without getting into it is hard to say.
Good luck.
-
Re: Editing cart contents -- esp products with attributes
Nope... that doesn't solve the issue.
-
Re: Editing cart contents -- esp products with attributes
Um, what doesn't solve what issue?
What did you do?
And after you did it, did the url to the product info page from the shopping cart look like a standard url or like an Simple SEO mod url?
Or did it change the url correctly but not change the behaviour on the product info page?
Justin
-
Re: Editing cart contents -- esp products with attributes
Quote:
Originally Posted by
justinhunt
Actually, I just went off and did something else (put down the futons) and then I realized there is a way.
If you alter the link used in the tpl_shopping_cart_default.php template file so that it doesn't go through the Simple SEO mod, then it will work. That will probably mean hacking the /includes/modules/pages/shopping_cart/header_php.php file, though it might be possible to duplicate the default link making function for product info pages into your template file.
If you follow what I am saying then maybe you can make those changes yourself. If not, I can probably do it for you. But we would probably need to have a discussion via PM about it.
Justin
Hi Justin,
Great mod. The edit cart is exactly what we are looking for. I installed it and it works great as long as I have our Ultimate SEO mod turned off. If I turn Ultimate SEO on I receive a page not found when I attempt to edit a product's attributes. As mentioned above, it looks like there were some users who had an issue with the Simple SEO mod. Do you know if there is a fix? I wasn't sure what was meant by the above comment regarding hacking the header.php file. any advice on how to use Ultimate SEO along with edit cart would be great.
Thanks,
M
-
Re: Editing cart contents -- esp products with attributes
Hi mkopecky
The thing is that there is really no problem with edit cart. The problem is with the way the SEO mods, make their urls.
On our kuroobiya site, here is a link to the product page for a karate uniform:
http://kuroobiya.com/shop/index.php?...products_id=48
Now if we set some attributes and head off to the shopping cart page, the link to return to the product info page looks like this:
http://kuroobiya.com/shop/index.php?...1c580eb95c0d1b
The trailing string at the end, on the second link, contains the information about the attributes that were selected. This is all standard zencart, there are no modifications here.
So if you want to modify the attributes you selected you click on the link in the shopping cart and head back to the product info page. Editcart doesn't change this either. Only once you get to the productinfo page, Editcart looks for the trailing string and turns the page into an Edit page (as opposed to an add page).
BUT the SEO mods remove the trailing string, so it is not there.
You can see this even without editcart. In standard zen cart the attributes previously selected , say size, color, will be selected on the return to the product info page from clicking on the shopping cart link. ( But in standard zen cart of course there is no edit button, only an add button on that page). However if you use an SEO mod none of the pre selected attributes will be selected in the product info page on the return there. That information just gets thrown away.
The solution I proposed earlier was to change the tpl_shopping_cart_default.php template file so that the links generated there do not go through the SEO mod, but are produced like standard zen cart links. This would work, but you need to do some coding.
I honestly do not have time to just do that from the goodness of my heart, I moved on long ago, and am working on other things now that take up most of my time. But I know that some people need this functionality. So if someone who can code, can get in there and do it, I would be grateful.
Otherwise if I am to do it, well I will just have to put out my hand and say PM me.
I hope that I have explained the problem ok. If it is still unclear, please let me know. Good luck
Justin
-
Re: Editing cart contents -- esp products with attributes
Hi Justin,
Thanks for the reply and the additional information. I knew it would involve some coding, but wasn't sure what. I'll send you a pm.
Thanks
mkopecky
-
Re: Editing cart contents -- esp products with attributes
This is a great mod that has been broken by using an SEO mod like many others have experienced.
I am using Ceon URI Mapping and don't know if the following fix will work for any other SEO mods but it seems to work for me :)
In tpl_product_info_display.php, change:
//add Justin Edit_Cart Mod 20080224
if(is_numeric($_GET['products_id'])) {
$cartAction="add_product";
}else{
$cartAction = "edit_product_in_cart";
}
to:
//add Justin Edit_Cart Mod 20080224
if($_SERVER['QUERY_STRING'][0] == ':') {
$_GET['products_id'] = $_GET['products_id'] . $_SERVER['QUERY_STRING'];
}
if(is_numeric($_GET['products_id'])) {
$cartAction="add_product";
}else{
$cartAction = "edit_product_in_cart";
}
The bit in red is what you need to add.
All it does is rebuild the products_id value that should be passed through to the product info page but gets stripped out by the SEO mod.
Let me know if anybody spots a problem with this fix please!
-
Re: Editing cart contents -- esp products with attributes
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>
-
Re: Editing cart contents -- esp products with attributes
Hi Damian,
Thanks so much for those changes, it's really great. I am a bit slow off the mark with zencart with these days, but I will add those changes to the editcart mod asap.
Justin
-
Re: Editing cart contents -- esp products with attributes
No problem Justin; I'm happy to give something back!
It's normally me asking for help :D
-
Re: Editing cart contents -- esp products with attributes
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
-
Re: Editing cart contents -- esp products with attributes
I have installed it and like this mod however just a slight problem that i can see in terms of user functionality.
On my site i sell outdoor apparel and if someone buys a jacket in a size / colour combo and goes to the cart then decided they want another one they will click on their chosen product and go back to the product info page. However they can only edit the 1 item in their cart and not add further variations of this product to their purchase.
My issue is what if they want to order another size / colour combo of the same product as a second item?
i.e. they buy jacket a in black small, how do they then buy jacket a in navy medium?
-
Re: 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
-
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.
-
Re: Editing cart contents -- esp products with attributes
Quote:
Originally Posted by
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
-
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.
-
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.
-
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 ...
-
Re: Editing cart contents -- esp products with attributes
Quote:
Originally Posted by
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
-
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.
-
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
Code:
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
-
Re: Editing cart contents -- esp products with attributes
It should work ...
Have you tried it? :smile:
-
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.
-
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!
-
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.
PHP Code:
//================================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:
PHP Code:
<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.
-
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"?
-
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.
-
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:
PHP Code:
<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).
-
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....
-
Re: Editing cart contents -- esp products with attributes
Quote:
Originally Posted by
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?
-
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:
-
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/p...b3b62b1c15e04a - but still is unable to adjust it useing this mod. Shame, would really love it to work.:(
-
Re: 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:
-
Re: Editing cart contents -- esp products with attributes
Quote:
Originally Posted by
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:
-
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!
-
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):
Code:
// 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:
Code:
// 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
Code:
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
Code:
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
Code:
if(is_numeric($_GET['products_id'])) {
$cartAction="add_product";
}else{
$cartAction = "edit_product_in_cart";
}
be replaced with (or something like)
Code:
if(is_numeric($_GET['products_id'])) {
$cartAction="add_product, $request_type";
}else{
$cartAction = "edit_product_in_cart";
}
Thanks in advance
-
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.
-
Re: Editing cart contents -- esp products with attributes
Quote:
Originally Posted by
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.