Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

How to add "Add to Cart" on homepage?


Recommended Posts

I am having trouble trying to add an "Add to cart" button (or link) beneath the price of a product in the "New Products" section of the homepage.


I want the table cell containing the product to look like this:



[Title with link to Product Info]


[Add to Cart button]


Any idea how to do this?!


Many thanks,


Link to comment
Share on other sites



I think that does what you want. That is for the new products for month box.


There is this one too


same deal

Wendy James


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

Link to comment
Share on other sites

Thanks. I managed to work out a solution on my own but will keep these contribs on file for the future.


For anyone interested, you can add a link to "Add to cart" anywhere that you are displaying a product using this code:


<? php '<a href="' . 'index.php?action=buy_now&products_id='.$new_products['products_id'] .'">add to cart</a>' ?>


The end result is that you want to create a URL that looks like this:



...where "123" is the product ID of the current product.




Link to comment
Share on other sites


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

  • Create New...