Show item in cart


1196
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>

Information(1)
General information
 Lazy Loading
Post counter
Current information status:
Categories: 8
Posts: 104
Support pages: 51
Downloads for members: 104
Download counter: 646