Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Putting "Product added to cart" message on product_info page


Recommended Posts

I only add to cart from the product page and simply show a mini-cart at the top of the page.


However, I'd like to add the text 'Added to Cart' next to the add_to_cart button on the product page after the item has been added.


Any ideas?




Have a read thru this page for background info. I followed it and made it work on my site. In /catalog/product_info.php, near the end where you have add to cart button, replace with something like this


				<td class="main" width="25%" align="center"><?php

			if ($cart->in_cart($listing['products_id'])){
			echo tep_image_button('button_added_cart.gif', IMAGE_BUTTON_ADDED_CART);
			} else {
			echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_IN_CART);} ?></td>


I have done it so if in cart show a greyed out add to cart button.


See it in action at My Website. It's easier to see if you pick category or genre in the left column. Add to cart then continue shopping.





Link to comment
Share on other sites


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

  • Create New...