Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

adding a button


dandelion

Recommended Posts

Posted

In my admin I turned off the show cart after an item is added to the cart - I want them to add more before they go to the cart, but now I want to add a button at the bottom of the product page next to add to cart that says view cart.

 

This is the code at the bottom of product_info.php

 

<td class="main" align="left"><?php echo TEXT_QUANTITY . tep_draw_input_field('quantity', '1', 'SIZE=2 maxlength=2') . tep_draw_separator('pixel_trans.gif', '75', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'); ?></td>

 

I want to add a new button 'button_view_cart.gif'. So this is how I changed the code and I know it's wrong:(

 

<td class="main" align="left"><?php echo TEXT_QUANTITY . tep_draw_input_field('quantity', '1', 'SIZE=2 maxlength=2') . tep_draw_separator('pixel_trans.gif', '75', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'). tep_draw_separator('pixel_trans.gif', '75', '1') .
<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'button_view_cart.gif'); ?></td>

 

You think I would be able to make simple code changes by now!

Posted

try this:

 

<?php echo TEXT_QUANTITY . tep_draw_input_field('quantity', '1', 'SIZE=2 maxlength=2') . tep_draw_separator('pixel_trans.gif', '75', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'). tep_draw_separator('pixel_trans.gif', '75', '1') . '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image_button('button_view_cart.gif', IMAGE_BUTTON_VIEW_CART); ?></a></td>

 

of course you will have to upload a button_view_cart.gif to the button folder in your language file ...

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...