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.

 

Need help creating a currency default tool for VIrtuemart

Need help creating a currency default tool for VIrtuemart

I have created a Shopper Field In VM called "Preferred Currency" preferred_currency with 2 options:
1 - USD
2 - CAD

I have created a Chameleon Rule with some php which "should" accomplish this but it doesn't work

The PHP I have added is below. Can you make some suggestions?
JomGeniusClassVirtuemart::loadVmConfig();
$userModel = VmModel::getModel('user');
$userDetails = $userModel->getCurrentUser();
$userInfo = $userDetails->userInfo;
if (count($userInfo)) {
  if (end($userInfo)->preferred_currency == 2) {
    return true;
  } else {
    return false;
  }
  } else {
    return false;
  }

Can you help?

Cheers

metabern
Beginner Modder
ranks
useravatar
Offline
18 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1674
Total Polls:
6
Total Posts:
5917
Total Posts Today:
5
User Info:
 
Total Users:
11540
Newest User:
caron5112
Members Online:
1
Guests Online:
181

Online: 
caron5112

Forum Legend:

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