Show item in cart


english 7634
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 2 Reviews
Awarded 2 x 5  Stars
Information(1)
General information
 Free advertising
Post counter
Current information status:
Categories: 9
Posts: 104
Support pages: 55
Downloads for members: 104
Download counter: 646
Reviews total61
Companies: 26
Support: 28
Information: 7