Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

VirtueMart shopping cart recipe

VirtueMart shopping cart recipe

Hi Stephen,
I wonder if it's possible to write such a rule: show virtuemart shopping cart module only if it's not empty (for standard virtuemart shopping cart module)...
Regards,
Marius

mariuszstach
Beginner Modder
ranks
useravatar
Offline
12 Posts
Administrator has disabled public posting

Re: VirtueMart shopping cart recipe

HI Marius,

as it happens, I have been doing some VM work recently that will eventually make it into MetaMod and make it much easier to achieve this...

Meanwhile, I think this will do what you want:

Code:

$cart = @$_SESSION['cart'];

if ($cart == null or @$cart["idx"] == 0) {
  return XXX; // replace XXX with shopping cart module id
}

Bear in mind though, that with VM you can usually add items to the cart without doing a page refresh. (it adds via ajax). So without a page refresh, this code will not be run, and there won't be a shopping cart module on the page even though there may be products in the cart, until the page is refreshed somehow.

Just something to watch out for...

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Re: VirtueMart shopping cart recipe

You're the man Stephen. Thanks a lot

mariuszstach
Beginner Modder
ranks
useravatar
Offline
12 Posts
Administrator has disabled public posting

Re: VirtueMart shopping cart recipe

You're welcome.

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4412
Newest User:
doyal54741
Members Online:
1
Guests Online:
210

Online: 
doyal54741

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked