hello
i want Show Total number of Products added in the cart in the add to cart popup
also i used this cod but it don't show the correct number of products added to the cart as you look here https://www.screencast.com/t/5ExwsZL9su
$cart = VirtueMartCart::getCart(); //getting cart object
$dat = $cart->cartProductsData;
echo "Total Product Count: " . count($dat)."\n";
$cart->prepareCartData();
how can i fix this please ?
if u mean the add to cart "product added" popup it is rendered by the file
com_virtuemart\views\cart\tmpl\padded.php
over ride that and the total should be available as
count($this->products)
if this hasn't the correct quantity check what else is available in $this
or within the loop do a cumulative count to find the total
I guess count($this->products) would not give the correct answer if You order more than one from an item. As GJC said check $this for more info.
Jörgen @ Kreativ Fotografi
ok thanks , also how to get the same number that is on the cart module https://www.screencast.com/t/ejjsu815 ?
thanks
amine
within the loop do a cumulative count to find the total
can you please tell me what is the cod that i must add to get it ?
(https://image.ibb.co/bJD9po/cod.jpg) (https://ibb.co/fmY9po)
your cod is not workings ;D
can you please tell what the php cod that i must add to fix this ?
Afraid when code starts getting written then the wallet has to come out... you can PM me if u want to go further