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:

postcode not in list 15 Jan 2014 10:08 #1

  • athenacraftsltd
  • athenacraftsltd's Avatar Topic Author
Sorry for the unclear title. I want to write a rule to offer a specific shipping method to a customer whose postcode is not in a given list. I'll give you an example.

I want customers who are in mainland UK to have the option of Standard Shipping or Next Day courier. I don't want to offer the next day courier to customers in remote areas (it won't be possible to get the items to them so quickly).

While I appreciate I can write a rule for the postcodes in the remote areas with a NoShipping clause, I don't want to generate a warning telling them they can't have it. I just want them to see the one option for standard delivery, and only offer the Next Day option to customers not in the remote areas list.

So, I'm looking for an alternative to:
UK_Outward not(in list("AB37","AB38","AB44","AB45","AB53","AB54","AB55","AB56","CA18","CA19","CA20","CA21","CA22","CA23","CA24","CA25","CA26","CA27","HS1","HS2","HS3","HS4","HS5","HS6","HS7","HS8","HS9","IV14","IV15","IV16","IV17","IV18","IV19","IV20","IV21","IV22","IV23","IV24","IV25","IV26","IV27","IV28","IV30","IV31","IV32","IV36","IV40","IV41","IV42","IV43","IV44","IV45","IV46","IV47","IV48","IV49","IV50","IV51","IV52","IV53","IV54","IV55","IV56","IV7","IV9","IV10","IV11","IV12","KA27","KA28","LA15","LA16","LA17","LA18","LA19","LA20","LA21","LA22","LA23","PA20","PA21","PA22","PA23","PA24","PA25","PA26","PA27","PA28","PA29","PA30","PA31","PA32","PA33","PA34","PA35","PA36","PA37","PA38","PA41","PA42","PA43","PA44","PA45","PA46","PA47","PA48","PA49","PA60","PA61","PA62","PA63","PA64","PA65","PA66","PA67","PA68","PA69","PA70","PA71","PA72","PA73","PA74","PA75","PA76","PA77","PA78","PA80","PA81","PA82","PA83","PA84","PA85","PA86","PA87","PA88","PH17","PH18","PH19","PH20","PH21","PH22","PH23","PH24","PH25","PH26","PH30","PH31","PH32","PH33","PH34","PH35","PH36","PH37","PH38","PH39","PH40","PH41","PH42","PH43","PH44","PH49","PH50","TR21","TR22","TR23","TR24","TR25","BT") OR UK_Area in list("IM","KW","ZE"))

postcode not in list 15 Jan 2014 10:29 #2

  • athenacraftsltd
  • athenacraftsltd's Avatar Topic Author
Ok, I see a potential workaround in using the NoShipping rule and not including a name, however the errormessage banner still appears, it's merely empty.
I'm open to suggestions :)

postcode not in list 15 Jan 2014 10:55 #3

Actually, the NoShipping case was intended for this very purpose. Please upgrade to version 4.1 of the plugin, which will no longer try to print a warning if a rule does not have a name set. E.g. in Version 4.1 you can use a rule like
Comment="No Shipping to remote area"; not(UK_Outward in list("AB37", .......) OR UK_Area in list("IM", "KW", "ZE")); NoShipping

The Comment will not be displayed to the user and is just meant as a comment for you as web developer as a note what the rule is for.

postcode not in list 15 Jan 2014 11:24 #4

  • athenacraftsltd
  • athenacraftsltd's Avatar Topic Author
That's brilliant, thank you Reinholder.

You've actually answered both of my questions there! I'd clearly made a mess of the "not in" syntax, but I think your NoShipping/Comment upgrade will do the job very nicely.

postcode not in list 15 Jan 2014 11:32 #5

  • athenacraftsltd
  • athenacraftsltd's Avatar Topic Author
Oops, should have tested it before responding.

I've installed the newer version, removed the shipping name and added a comment but it's doing exactly the same - generating an empty error container:
<div id="system-message-container">
	<dl id="system-message">
		<dt class="error">Error</dt>
		<dd class="error message">
			<ul>
				<li></li>
			</ul>
		</dd>
	</dl>
</div>

Did I do something wrong?

postcode not in list 15 Jan 2014 12:05 #6

Do you have both the basic and the advanced shipping by rules plugins installed? In that case, please update both, since both of them have a copy of the same base class. If only one is updated, joomla might use the base class of the outdated plugin (where the bug was not fixed)...

postcode not in list 15 Jan 2014 12:36 #7

  • athenacraftsltd
  • athenacraftsltd's Avatar Topic Author
Perfect, thank you.

[SOLVED] postcode not in list 15 Jan 2014 12:36 #8

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