Show item in cart


english 4111
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>
Why your email address?
If necessary, I will contact you to help you with the implementation.
Your email address will not be made public.
Is this post helpful to you?
Average overall rating
 off 1 Rating
Awarded 1 x 5  Stars
Information(2)
General information
 Free advertising
 Lazy Loading
Post counter
Current information status:
Categories: 8
Posts: 104
Support pages: 54
Downloads for members: 104
Download counter: 646
Reviews total58
Companies: 26
Support: 25
Information: 7