Quote:
Originally Posted by DanUK
Is there also a statement along the same lines to check for a particular item in the cart?
|
I looked all over for this recently and then ended up just coding it myself in products.tpl. Should be a similar process for any other page. For the curious:
4.1.3
products.php
before
Code:
$smarty->assign("products",$products);
add
Code:
x_load('cart');
require $xcart_dir."/include/cart_process.php";
x_session_register("cart");
$cartprods = func_products_in_cart($cart, $membershipid);
foreach($cartprods as $product){
$prodids[$product['productid']] = 'Y';
}
$smarty->assign("cartprods",$prodids);
then in products.tpl
Code:
{assign var="pid" value=$products[product].productid}
{if $cartprods[$pid] eq "Y"}
...
{else}
...
{/if}
hope that helps.