Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I need help adding an add to cart button.


LEGACYEYES

Recommended Posts

I'm a noobie, and I need help adding an add to cart button. Go to legacyactionsports.com. Go to Eyewear, then to sunglasses, then to the Black Flys icon in the center of the page. Click it, then click the Bella Fly thumbnail. I would like to have the add to cart button on this page. If anyone has the patience to help, I would really appreciate it.

 

Thank you,

 

Mike

Link to comment
Share on other sites

Yeah, you need an add to cart button. Who did this for you?

 

Biggest problem I see is that you have three seperate forms that hold information you need.

<form name="formColor" style="display:inline">

<form name="formSize" style="display:inline">

<form name="formQty" style="display:inline">

None of these forms have a submit button - nor do they specify POST or GET..

I am not sure, but I believe you can only send one forms information to the browser and that would be with a submit within that form. So with the way it is set up now, you will not be able to retrieve all three values.

 

I do not know how you can get any information from these.

 

Seems to me that you should have all these values located within one form and include the submit (add-to-cart) button in the same form. Then specify whether these values will be sent to the browser via POST or GET method.

Lloyd

Link to comment
Share on other sites

Yeah, you need an add to cart button. Who did this for you?

 

Biggest problem I see is that you have three seperate forms that hold information you need.

<form name="formColor" style="display:inline">

<form name="formSize" style="display:inline">

<form name="formQty" style="display:inline">

None of these forms have a submit button - nor do they specify POST or GET..

I am not sure, but I believe you can only send one forms information to the browser and that would be with a submit within that form. So with the way it is set up now, you will not be able to retrieve all three values.

 

I do not know how you can get any information from these.

 

Seems to me that you should have all these values located within one form and include the submit (add-to-cart) button in the same form. Then specify whether these values will be sent to the browser via POST or GET method.

 

 

 

 

Hi Lloyd,

 

Thanks for your response! A friend of mine did the frame work, I added the specifics. He has never framed the commerce aspect of a site, so didn't know when and where to integrate. When I made the form lines, I didn't know that was the section where I would link it to the cart. I don't know the code for the cart, so I am having trouble directing the links.

 

Thank you,

 

Mike

Link to comment
Share on other sites

Check out this page:

catalog/application_top.php Line 360

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

 

Plus on this page

catalog/products_info.php Line 47

<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'));

 

The form on the products_info page sends the variable 'action=add_product' to the application_top page which then runs the function $cart->add_cart().

 

The add to cart button is on page products_info.php Line 213

<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>

 

Try and stay within this framework..

 

You will need to use the same code for the button making sure that tep_draw_hidden_field('products_id', $product_info['products_id']) writes the product_id in place of $product_info['products_id']. I say this because I do not know if the orifinal products_info page is still on your site. So perhaps if the array $products_info is no longer in place than substitute it for whatever is holding the value.

Lloyd

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...