VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Shipping by Rules for VirtueMart

We are currently unable to provide proper support!

For the last few months we have been very busy working on some huge, very time-consuming and time-sensitive projects, so our support was very limited and we were unable to provide proper support in our forums! We now have a huge backlog of requests from our customers, which we are trying to clear bit by bit. Unfortunately, this takes longer than we anticipated, so our response time is not yet up to par. We are trying our best to improve this situation as soon as possible.

Sorry for the inconvenience and thank you for your understanding!

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: [SOLVED] ShopperGroups IS Unknown variable

ShopperGroups IS Unknown variable 02 Feb 2018 12:10 #1

  • florihana
  • florihana's Avatar Topic Author
  • Offline
  • Posts: 13
Hi,
I tried to implement the logical if ShopperGroups is ID 5. Then use the reduction:
Variable=ShipReducedRate; Value=0.1*BasePrice
Name="Shipping complex function";ShopperGroups=5;0.001<=Weight<=0.65;Shipping= Max(6, 19.08-ShipReducedRate)

but it return this error message:
Unknown variable 'ShopperGroups' in rule 'ShopperGroups=5'

from doc which said ShopperGroups should be available variable:
ShopperGroups, Groups VirtueMart shopper groups and Joomla user groups (numeric IDs) of the customer if logged in. Guest users will have the default VM shopper group and an empty groups list. (ADVANCED VERSION only)

could I know this is possible to fix?

I used "Advanced Shipping by Rules" and with joomla 3.6 AND virtuemart 3.0.8 BY THE WAY

thank you so much

Please Log in or Create an account to join the conversation.

ShopperGroups IS Unknown variable 03 Feb 2018 16:39 #2

Dera Forihana,
The "=" operator is an assignment, it it says that "ShopperGroups" should get the value 5, which is not what you have in mind. Admittedly, the error message is not very clear...

As ShopperGroups is a list, you rather want to check whether 5 is in the ShopperGroups list:
Variable=ShipReducedRate; Value=0.1*BasePrice
Name="Shipping complex function"; 5 in ShopperGroups; 0.001<=Weight<=0.65;Shipping= Max(6, 19.08-ShipReducedRate)
Alternatively, you can use "contains_any(ShopperGroups, 5)"

Best regards,
Reinhold

Please Log in or Create an account to join the conversation.

ShopperGroups IS Unknown variable 05 Feb 2018 09:59 #3

  • florihana
  • florihana's Avatar Topic Author
  • Offline
  • Posts: 13
Hi Reinhold,

Thank you so much, yes right now has show no more error message
But my case is kind complex which is:

1. If shopperGroups belong any discount group( in my case is ShopperGroups == 5 AND ShopperGroups == 12 OR ShopperGroups == 13), then it will take whole shipping price

2. If shopperGroups belong only normal group ( in my case is ShopperGroups ONLY HAS VALUE == 5), then it will take discout

Because any shopper at lease will have shopperGroups value == 5 by defalut when he create account, BUT it could be add more value like 12 or 13 or more other value
so I tried to write follow rule:

Variable=ShipReducedRate; Value=0.1*BasePrice
Name="Shipping full function"; Condition=contains_any(ShopperGroups, 12,13); 0.001<=Weight<=0.65;Shipping= 19.08
Name="Shipping complex function";Condition=contains_only(ShopperGroups, 5); 0.001<=Weight<=0.65;Shipping= Max(6, 19.08-ShipReducedRate)

I test weather I add shopperGroup 12 OR only default 5
The result is always take the first one: 19.08

Any ideal?
Thank you Reinhold
Appreciate your help

Please Log in or Create an account to join the conversation.

ShopperGroups IS Unknown variable 05 Feb 2018 11:48 #4

  • florihana
  • florihana's Avatar Topic Author
  • Offline
  • Posts: 13
Hi Reinhold,
After different method test finally I got this method pass:

Variable=ShipReducedRate; Value=0.1*BasePrice
Name="Shipping complex function";Condition=contains_only(ShopperGroups, 5);0.001<=Weight<=0.65;Shipping= Max(6, 19.08-ShipReducedRate)
Name="Shipping Full Price";0.001<=Weight<=0.65;Shipping= 19.08

Thank you so much, this is resolved

Please Log in or Create an account to join the conversation.

[SOLVED] ShopperGroups IS Unknown variable 05 Feb 2018 11:48 #5

  • florihana
  • florihana's Avatar Topic Author
  • Offline
  • Posts: 13
Problem solved.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1