Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Moving "Add To Cart" Button from bottom to TOP


Guest

Recommended Posts

Does anyone know how I can move my "Add To Cart" button on each product listing from the bottom of the page, to the top (or both). Both would be GREAT.

 

Here is my URL to my webstore: http://www.giftsforgrabs.com

 

and here is an URL to a sample listing, and you will see why I want to do this (the listings are very large thats why).

 

http://giftsforgrabs.com/product_info.php?...&products_id=29

 

Please help... Thanks!

Link to comment
Share on other sites

On my site I put this...

 

<tr><?php if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

} ?>

<td><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?> </span></td>

</tr>

 

where I wanted the button to show up, on product_info.php

 

it is actually 2 parts located on the page

 

<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

 

and

 

<?php if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

} ?>

 

moved from other areas. if you do not put the php part of the code inside the <tr> where the cart button appears it doesn't seem to work, atleast for me.

 

 

Hope that made sense and helps. =)

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

So all I have to do is edit one page, product info.php?

 

And let me get this straight, that code you gave me is for editing it so that the add to cart button shows up at the TOP & BOTTOM? Correct? Or no?

 

If I am correct, do you think you could email me that edited productinfo.php file? It would be GREATLY appreciated! [email protected]. Please let me know, thanks.

Link to comment
Share on other sites

Yes, the product info is the only page you need to edit if you just want to move the buy now button when viewing a product.

 

And I didn't tell you where to put it, just what the code was. You can put that at the top, the bottom, on the side, under the image, under the definition, under the name... where ever you want it to show up on the page.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Okay, where do you "put the code then"... Cant you just upload or e-mail me the file (as a text file or .php file) (the productinfo.php file).

Link to comment
Share on other sites

Okay, where do you "put the code then"... Cant you just upload or e-mail me the file (as a text file or .php file) (the productinfo.php file).

Link to comment
Share on other sites

How do I know where you want the code to go? It can go anywhere on the page. I gave you the code, the best thing to do is just try and edit the page yourself, it really isn't that hard considering I told you what to use to make it work.

 

You just put the code I posted on your product_info.php where you want the button to show up.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Sorry one more question..

 

Am I editing the productinfo.php in the ROOT directory, or the one in /includes/languages/english/productinfo.php Thanks!

Link to comment
Share on other sites

Sorry one more question..

 

Am I editing the productinfo.php in the ROOT directory, or the one in /includes/languages/english/productinfo.php  Thanks!

 

Nevermind, I got it. Thanks soo much for the help!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...