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:
Printable View
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:
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
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.
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 :
Then go a little further down the file, and find this lineCode:<!--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-->
Comment (or delete) that line and all subsequent lines until , but NOT including the nextCode:if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
Then just above that , [add these linesCode:} else {
And you are all done! I hope it is helpful.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);
}
Justin
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...
Oooops, sorry those enclosing tags should be
<!--bof Form start-->
<!--eof Form start-->
Justin
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-->
Yes.
Get stuck into it JimmyX, and just make the changes. It'll work.
J
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.
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