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:

Testing for UK postcodes 26 May 2017 01:02 #1

  • skaas
  • skaas's Avatar Topic Author
Greetings,

I am testing your product using the demo site.
As per your documentation I attempted to recreate the set rule for UK postcode ranges.
Using a direct copy and paste from said manual.

Name="Free shipping to parts of Walsall"; UK_Area=="WS" AND 15<=UK_District; Shipping=0

I have played around with various billing addressess but I cannot get the rules to fully save. The values appear to be getting clipped.
Upon clicking save the rules appear as:

Name="Shipping 15 to parts of Walsall"; UK_Area=="WS" AND 15

I have attempted to save on several occasions now. The rules refuse to save or show up in the cart for selection.
Is there an issue with your demo site? Or am I doing something wrong? ... I am very much interested in this plugin, however it will not suit my needs if not catered towards UK postcode ranges.

Testing for UK postcodes 26 May 2017 14:55 #2

  • skaas
  • skaas's Avatar Topic Author
Ok, so I have been playing with the test site some more.
Seems I have no problem setting singular postcodes using the following syntax;

Name="Don"; UK_Outward=="DN1"; Shipping=10
Name="Don2"; UK_Outward=="DN12"; Shipping=5

This gives different shipping costs based upon the outward value being static only.

I could achieve similar/desired results on cart using individual postcodes, though this is inconvenient.
If I attempt to use the following rules, it still is clipped and naturally throwbacks errors.

Name="Drange1"; UK_Area=="DN" AND 9<=UK_District; Shipping=10

Is there anything wrong with the syntax I am attempting? It looks ok to me?

Thanks in advance for any sort of replies.

Testing for UK postcodes 27 May 2017 21:25 #3

Dear Skaas,
Thank you for noticing the issue that the rules are cut off at the < in the latest VM version. This only happens for non-admin users (the test user at our demo site is not an admin user!), because Joomla and VM by default try to filter out all HTML code from any input field, even though the rules input field clearly is not and is also not intended to be a HTML input.
We are mostly testing as a Joomla super user, so this issue has eluded our tests so far.

As a workaround you can simply swap the left and right side so the condition reads "UK_District>=15". VM/Joomla don't cut off at the >, only at the opening <.

BTW, if you have two conditions that need to be fulfilled at the same time, you don't need to use AND, but can simply separate them by a semicolon:
Name="Free shipping to parts of Walsall"; UK_Area=="WS"; 15<=UK_District; Shipping=0

Best regards,
Reinhold

Testing for UK postcodes 28 May 2017 00:17 #4

  • skaas
  • skaas's Avatar Topic Author
Many Thanks for the response.

This would make some sense, one assumes that with super user privelages the coding would not be clipped (with a no filter rule applied).
I am finding many of the functions useful and will likely purchase the plugin.

Thank you for the heads up regarding the "AND" operator, I merely copied the example from the documentation.
Is it possible to define postcodes as a list or array?

Something like: Name="Don1"; UK_Outward=="DN1"; UK_Outward=="DN3"; UK_Outward=="DN5";Shipping=10

Thusly skipping shipping displays for certain area codes? The idea is we provide a delivery service based upon a radius distance from our base location depending on the distance to the customer. Eg; within 5 miles=£10, within 10 miles=£15 ... etc, UK postcodes are giving me the biggest headaches right now.

Thanks again.

Testing for UK postcodes 04 Jun 2017 16:03 #5

Dear Skaas,
Regarding your example:
Name="Don1"; UK_Outward=="DN1"; UK_Outward=="DN3"; UK_Outward=="DN5";Shipping=10

This is certainly not correct. As I tried to explain, all conditions need to be simultaneously fulfilled for the rule to apply (ie. think of an AND instead of each semicolon). Now, it is not ever possible to have UK_Outward equal to "DN1" and equal to "DN3" at the same time...
I suppose, you rather want to use OR between the rule parts. This has to be explicitly written (only AND can be left out):
Name="Don1"; UK_Outward=="DN1" OR UK_Outward=="DN3" OR UK_Outward=="DN5";Shipping=10

Regarding your distance-based shipping, I am not aware of a better solution (except using some third-party, external services that calculate distance from given addresses).

Best regards,
Reinhold
  • Page:
  • 1