News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Empty Cart

Started by fabioweb, October 17, 2016, 10:05:01 AM

Previous topic - Next topic

fabioweb

Hello!
if i go to cart without product what's the best way to add a message: Your cart is empty?
http://seratadigala.tioitalia.it/it/il-mio-carrello

Thank you

GJC Web Design

in the cart default template do a if and else

detect if the cart has  products .. if so display the template..  if not show the message
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

fabioweb

Oky i can't see anything so i've add this code:
it works correctly in my 3.0.18 version and i hope also for future updates

$cart = VirtueMartCart::getCart();
if(sizeof($cart->products) > 0){
echo 'Cart have products';
}
else{
echo 'Your cart is empty';
}


Thank you :)