![](/img/trans.png)
[英]Joomla Sessions and VirtueMart Cart - how to save cart information
[英]How to check virtuemart cart empty or not
我有一个问题,检查美德市场购物车,如果购物车是空的,然后页面重定向到我的链接,如联系页面,文章。
例如,客户点击“立即订购”按钮,但购物车为空,然后重定向到联系页面
请帮我
尝试这个,
$cart = VirtueMartCart::getCart();
if(sizeof($cart->products) > 0){
echo 'Cart have products';
}
else{
echo 'Your cart is empty';
}
对于重定向,您可以使用以下
$mainframe = JFactory::getApplication();
$mainframe->redirect('url','message','message type');//message type is message,warning,error etc
希望它的帮助..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.