Guest Posted November 3, 2005 Posted November 3, 2005 This is just a small modification to place an extra "Add to cart" button under the product image. Open catalog/product_info.php Find : <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> Add After: <TR><td align="center" class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> That's it, I came up with this after not finding a way on the web, or anywhere else, hope it is of use and I've coded it correctly. Just backup and try. :-"
Lavaman Posted January 2, 2006 Posted January 2, 2006 Struggling with this I'm afraid. Have added the above code as it says and the 'add to cart' button is now there but it's not 'clickable'. Is there anything else I need to change as well? Would also like to add a quantity box next to it as I have at the bottom of the page, again I managed to get this showing on the page but can't change the value. Thanks in advance for any pointers. :)
Guest Posted January 6, 2006 Posted January 6, 2006 Struggling with this I'm afraid. Have added the above code as it says and the 'add to cart' button is now there but it's not 'clickable'. Is there anything else I need to change as well? Would also like to add a quantity box next to it as I have at the bottom of the page, again I managed to get this showing on the page but can't change the value. Thanks in advance for any pointers. :) Afraid I'm not much help Antony, the button should add items to cart, you could try on a "fresh" ie out of the box product_info.php to see if it works there, of course back up your current one, if it works there you could compare the two product_info.php scripts to see if there is any difference between the two that might be affecting the outcome. I believe there might be a contribution regarding the product quantities thing.
kitchenniche Posted February 2, 2006 Posted February 2, 2006 This is exactly what i was looking for. Works great, thanks a lot HIM - Dark Light - Out on 26/09/05
Guest Posted February 9, 2006 Posted February 9, 2006 Afraid I'm not much help Antony, the button should add items to cart, you could try on a "fresh" ie out of the box product_info.php to see if it works there, of course back up your current one, if it works there you could compare the two product_info.php scripts to see if there is any difference between the two that might be affecting the outcome.I believe there might be a contribution regarding the product quantities thing. Hi, I used the code below to do something similar. This makes the actual image a clickable add to cart link with text underneath to say Add to cart. Hope it helps! <script language="javascript"><!-- document.write('<input type="image" src="<?php echo DIR_WS_IMAGES . $product_info['products_image']; ?>" value="submit"><br>Click above to<br>add to cart'); //--></script> <noscript> <input type="image" src="<?php echo DIR_WS_IMAGES . $product_info['products_image']; ?>" value="submit"> </noscript> Best wishes, Kevin.
spcrafts Posted May 12, 2006 Posted May 12, 2006 Thanks... Was also just what I was looking for. Simple quick and got the job done without problems. Didn't interfere with any of my mods. Cheers
ValleyRoaster Posted June 4, 2006 Posted June 4, 2006 Very easy install for hopefully more sales! Some of my descriptions are very long and an add to cart button at the top of the page is just what I needed! :D :thumbsup: Life Is Too Short, Enjoy Your Coffee! Pete
khoking Posted August 26, 2006 Posted August 26, 2006 great tips! The first post modification is fine and it works for my store perfectly! :thumbsup: Best regards, Koh Kho King
Guest Posted January 13, 2007 Posted January 13, 2007 Thanks a lot Tasker, that works really great. I always wondered about that, as many of my descriptions are a bit long, and I worried the customer would just give up before getting to the "add to cart" at the bottom. Now, all my images have the "add to cart" button below each and every one. Thanks!
blackie83 Posted January 19, 2007 Posted January 19, 2007 Hi i added the code below for STS and i am not able to click it using internet explorer, But firefox and opera is looking fine.
bobcast Posted January 28, 2007 Posted January 28, 2007 This is just a small modification to place an extra "Add to cart" button under the product image. Open catalog/product_info.php Find : <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> Add After: <TR><td align="center" class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> That's it, I came up with this after not finding a way on the web, or anywhere else, hope it is of use and I've coded it correctly. Just backup and try. :-" How do I make a link to add a product to the shopping cart, bypassing the description page? I only have one product for sale. My main page has a picture of that product, with no link. I want a buynow button that adds my product to the cart and pulls the cart page. I tryed linking the picture with the following but I don't think its the right way and it goes to the description page instead of the shopping cart page. I want shopping cart page with product already added. <META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://localhost/catalog/product_info.php?products_id=3?osCsid="> I think the above screws up the osCid if someone is signed in Also take me to the product info page.... and that's not what I want. I want it to go to the page just past that one. The one with the product in the shopping cart on the cart/checkout page. any sugestions?
JakeWear Posted January 28, 2007 Posted January 28, 2007 I fixed the problem with the script (minor... at the very begining you need to remove the open tag for <noscript>) I really like it. However, my items come in different colors and different sizes. Is there a way to move the additional attributes to the top? I'm a novice with PHP. Thanks Vicky This is just a small modification to place an extra "Add to cart" button under the product image. Open catalog/product_info.php Find : <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> Add After: <TR><td align="center" class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> That's it, I came up with this after not finding a way on the web, or anywhere else, hope it is of use and I've coded it correctly. Just backup and try. :-"
desklancer.com Posted January 21, 2011 Posted January 21, 2011 in product_info.php find <span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary', null, '1'); ?></span> and replace with <span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart'); ?></span> usually on line 306
Recommended Posts
Archived
This topic is now archived and is closed to further replies.