i want show the total number Products (carts Product) in the add to cart popup
also i used this cod in the padded.php
$cart = VirtueMartCart::getCart(); //getting cart object
$dat = $cart->cartProductsData;
echo "Total Product Count: " . count($dat)."\n";
$cart->prepareCartData();
but it does not show the the correct number
how can i fix this please ?
To get the count of total products, you can try like this
$cart = VirtueMartCart::getCart(); //getting cart object
$products = $cart->products;
echo "Total Product Count: " . count($products)."\n";
Thanks!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.