Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to display "this item is already in your cart" on product_info.php or product listing?


Jitty25

Recommended Posts

Posted

Hi,

 

I have been searching the forum for some time, but couldn´t find a code that would display something like "you already have this item in your cart" either on product_info or in thumbnail view of all products (even better).

 

I have this piece of code in wishlist.php and it does exactly what I need. If you have the item in your cart, it shows the sign on wishlist.php.

 

if($cart->in_cart($wishlist_id)) {
			echo '<br /><font color="#FF0000"><b>' . TEXT_ITEM_IN_CART . '</b></font>';
		}

 

Could you please help me modify the code so that I could insert it in product_listing.php or in product_info.php?

 

Thank you very much

Posted

Here is a possible solution :)

 

<?php

 

if ($_SESSION['cart']->in_cart($_GET['products_id'])) {

 

echo '<br /><font color="#FF0000"><b>' . TEXT_ITEM_IN_CART . '</b></font>';

}

 

 

?>

Archived

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

×
×
  • Create New...