Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add product + Buy-now button to frontpage


MLu

Recommended Posts

Posted

I plan to make a daily special offer where I put one particular product on the frontpage with a high discount. But I have not been able to find the code for this, in particular the functionality that would add the product to the customers basket if the "Buy-now" button is pressed. I do not look for anything fancy, and can hardcode the products_id for each of the index.php files under the respective languages.

 

Does anyone know a contribution that might do this, or where I can find the code?

 

Thanks

 

Mogens

Posted
I plan to make a daily special offer where I put one particular product on the frontpage with a high discount. But I have not been able to find the code for this, in particular the functionality that would add the product to the customers basket if the "Buy-now" button is pressed. I do not look for anything fancy, and can hardcode the products_id for each of the index.php files under the respective languages.

 

Does anyone know a contribution that might do this, or where I can find the code?

 

Thanks

 

Mogens

 

 

If you are hard coding links, make sure you are forcing cookies else you may lose session info.

 

Try something like:

echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO . 'action=buy_now&products_id=xx') . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>';

 

Replace the "xx" with your product id. It's basically the same code used in the product listing pages, just modified a little.

Archived

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

×
×
  • Create New...