Hey guys - so I have this issue here. What I needed was to create a cart icon and put it to my menu header. But I ONLY needed icon + a tiny little number of how much products is in a cart. Something like shopify has in a top right corner:
https://debut-demo.myshopify.com/
So what I did - I have published a VM - Shopping cart module in a header and I used a CSS to disable everything except number. But - it say "2 items" for example and it also says "cart is empty" when theres nothing in a cart. I tried to edit default.php file in tmpl but I cannot find a way to get rid of those texts :-D I only need numbers like 2 or 15 or so... Is there a way to do it?
Btw. I am on latest Joomla and latest VMart. ;-)
think $data->totalProduct is just a number ... but don't think it updates by ajax - only on refresh
to ajax it add
$(module).find(".cart_total").html(datas.totalProduct);
to the vm cart mod js
Wow! So your solution made me think and I found this line:
<div class="total_products"><?php echo $data->totalProductTxt ?></div>
I simply removed the Txt and now I only have a numbers there :-) Thanks mate!
then u will need to change in the js
$(module).find(".total_products").html( datas.totalProductTxt);
to
$(module).find(".total_products").html( datas.totalProduct);
OK will do thank you! ;)