Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

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!

×

Notice

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

TOPIC:

Code not picking up UK postcode 21 Mar 2015 10:13 #1

  • ChrisT
  • ChrisT's Avatar Topic Author
Hi,

I have been testing a code on your demo site and I can't get the code to pick up the post code of the customer from the form, it works whatever post code I put in for the customer. Also is there an easier way of writing this code?

My code is:

Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");
articles==1; 40
articles==2; 40
articles==3; 45
articles==4; 50
articles==5; 55
articles==6; 60
articles==7; 65
articles==8; 70
articles==9; 75
articles==10; 80

Code not picking up UK postcode 22 Mar 2015 13:14 #2

Dear Chris,
In the plugin, each line is interpreted as a separete rule, so you cannot write general conditions at the top and hope they will apply to all subsequent rules. Rather, you have to add the condition to every rule separately:
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles==1; 40
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles==2; 40
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles==3; 45
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles==4; 50
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles==5; 55
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles==6; 60
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles==7; 65
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles==8; 70
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles==9; 75
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles==10; 80

Looking at your cost structure, the shipping cost is 30 + 5*Articles, but at least 40 (when 1 article is ordered). So you can combine those rules into one single rule:
Name="Zone 1 Shipping";UK_Area in list ("DE","NG","LE");articles<=10; Shipping=max(40, 30+5*Articles)

Best regards,
Reinhold

[SOLVED] Code not picking up UK postcode 22 Mar 2015 17:23 #3

  • ChrisT
  • ChrisT's Avatar Topic Author
Problem solved.
  • Page:
  • 1