Show item in cart


97
With this code sequence you can place the display anywhere that this item has already been placed in the shopping cart.

Find in product_info.php
      if (tep_not_null($product_info['products_model'])) {
          $products_name = $product_info['products_name'] . '<br /><span class="smallText">[' . $product_info['products_model'] . ']</span>';
      } else {
          $products_name = $product_info['products_name'];
      }

Add after it:

// Item in cart bof
$products = $cart->get_products();
$in_cart = '';
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
$first = current(explode("{", $products[$i]['id']));
if ($first == $product_info_ajx['products_id']) {
$in_cart = '<i class="fa fa-cart-plus"></i>&nbsp;';
}}
// Item in cart eof

Find:

<h1><?php echo $products_name; ?></h1>

Change to:

<h1><?php echo $in_cart . ' ' . $products_name; ?></h1>

w3c-Commerce
w3c-Commerce Downloads
  w3c-Commerce Add-ons php8