我需要在页眉中显示购物车中的商品数量。
我试图将header.php
文件编辑为:
$products = $this->cart->getProducts();
$data['total'] = count($products);
然后在模板中显示这个header.tpl
:
<?php echo $total?>
我需要在页眉中显示购物车中的商品数量。
我试图将header.php
文件编辑为:
$products = $this->cart->getProducts();
$data['total'] = count($products);
然后在模板中显示这个header.tpl
:
<?php echo $total?>