Shipping by Rules for VirtueMart

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!



The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1


UK Postcodes 11 May 2015 15:45 #1

  • jon2396
  • jon2396's Avatar Topic Author
Can an* be used in a rule to denote anything?

SO for example I have some UK postcodes with shipping rates denoted:

SN8 3E*
SN8 3F*
SN8 3H*
The second character here would be a letter so what would the syntaxt be?

If the * cannot be used would it simply be a case of UK_Inward >3E<3ZZ ?

Any help greatly appreciated.

UK Postcodes 11 May 2015 21:57 #2

Dear John,
Unfortunately, there is no wildcard character that can be used to match the UK inbound.

There are, however, some ways to achieve something similar:
-) You can use substring(UK_Inward, 0, 2) to get only the first two characters of the inbound:
UK_outward=="SN8"; substring(UK_Inward, 0, 2) in list("3E", "3F", "3H"); shipping=123

-) You can use the regexp plugin (open-tools.net/virtuemart/advanced-shipp...ipping-by-rules.html ) to make a regular expression match on the outward. This basically achieves what you want with the wildcards, but is a bit more general, but also more complex:
UK_Outward=="SN8"; Condition=RegExpMatch("/^3[E-Z]/", UK_Inward) 

Best regards,

UK Postcodes 12 May 2015 08:08 #3

  • jon2396
  • jon2396's Avatar Topic Author
We tried the following rules, none of them got working :(

Name=Shipping; UK_outward=="RG17"; substring(UK_Inward, 0, 2) in list("0T", "0U", "0W"); shipping=123
Name=Shipping; UK_outward=="RG17"; substring(UK_Inward, 0, 3) in list("0TT", "0UL", "0WL"); shipping=123
Name=Shipping; UK_outward=="RG17"; shipping=123
Name=Shipping; substring(UK_Inward, 0, 2) in list("0T", "0U", "0W"); shipping=123

UK Postcodes 14 May 2015 14:19 #4

Dear John,
Do you get any error messages, or do the shipping costs simply not apply?
If you append a catch-all rule like
Name=Fall-through for testing purposes; Shiping=987
is this shipping rate offered at least? If not, then the shipping method is never even considered. If it is offered, then it really is an issue with the rules.

Which version of the plugin do you have installed?

Best regards
  • Page:
  • 1