Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to display "Add to Cart" button on top and bottom?


antoniamar

Recommended Posts

Posted

A few items in my catalog have very detailed descriptions. I would like the Add to Cart button to be available at the top of the page as well as the bottom. Anyone know how?

  • 11 months later...
Posted
A few items in my catalog have very detailed descriptions. I would like the Add to Cart button to be available at the top of the page as well as the bottom. Anyone know how?

 

 

I want to know too?

 

Anybody knows?

 

Rafa

OScommerce Rocks!

Posted

Modify product_info.php

 

 

Look for these lines near the bottom . This is from a fresh install

 

<tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
			<td class="main" align="right"><?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>
		  </tr>

 

The bit you want for the buy now or add to cart is this line-

 

 <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

 

Just place that where you want it at the top of product info php , you can put a seperator before and after it

 

eg -

 

<tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main" align="right"><?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>
		  </tr>

 

Just experiment with it's placement , a good place is after the product name and before the price. Just change the align right to left if you need to.

 

 

Back-up product_info before you mess around with it and make sure where you place it doesn't break your layout.

Posted
Modify product_info.php

Look for these lines near the bottom . This is from a fresh install

 

<tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
			<td class="main" align="right"><?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>
		  </tr>

 

The bit you want for the buy now or add to cart is this line-

 

 <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

Just place that where you want it at the top of product info php , you can put a seperator before and after it

 

eg -

 

<tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main" align="right"><?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>
		  </tr>

 

Just experiment with it's placement , a good place is after the product name and before the price. Just change the align right to left if you need to.

Back-up product_info before you mess around with it and make sure where you place it doesn't break your layout.

 

Nice Andy...

 

I will test, but you know if is possible insert two buttons, one on top and another on bottom using your method?

 

Tx in advance..

OScommerce Rocks!

Posted

Yes, it's easy , just leave the bottom one in place and place a copy at the top.

 

it works fine.

 

If all your descriptions are long then lt looks ok , but if you have any products that have a very short description then it can look a bit odd , as you will have a buy now buton , then a few lines of text , and another buy now button.

Archived

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

×
×
  • Create New...