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:

Syntax not correct for shipping rules 04 Oct 2013 23:04 #1

  • FDigital01
  • FDigital01's Avatar Topic Author
I have copied and pasted one of the examples and changed the amount to suit what i want:

Name=Free Shipping; 250>=Amount; 0
Name=Standard; Articles>1; Amount<250; Shipping=15.00

which i think means orders over $250 have free shipping and more than one article with a order value of less than $250 will have a shipping cost of 15.00 per order.

however, this is the error message i get when checking out:

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/theliteracy/www/shop5050/plugins/vmshipment/rules_shipping/rules_shipping_base.php on line 427


Can anyone help me with what i am doing wrong?

thank you

Syntax not correct for shipping rules 06 Oct 2013 17:12 #2

The syntax of the rule is correct, but the rule does not express what you want. In partitular, "250>=Amount" means that 250 needs to be a larger value than the bill amount, i.e. the bill amount must be smaller or equal to 250. I guess you want "250<=Amount", i.e. orders of 250$ or more.

The warning (not an error message) should be fixed in the latest version on the homepage.

Best regards,
Reinhold

Syntax not correct for shipping rules 07 Oct 2013 07:40 #3

  • FDigital01
  • FDigital01's Avatar Topic Author
I am sorry, but i do not understand. What do i put in if the shipping OVER $250 is free and under $250 is $15?

I have uploaded the latest version of the plug-in but i am still getting the warning... should i uninstall the plug in completely and reinstall?

thank you

Syntax not correct for shipping rules 11 Oct 2013 13:50 #4

Regarding the warning: Do you have both the basic and the advanced plugin installed? If so, have you installed the latest version of both? (Please note that the version on the homepage should have two warnings fixed, so it is different from earlier downloads of version 3.3. I didn't deem it neccessary to increase the version number for just a warning fix).
Is the warning exactly the same (i.e. is the line number still 427 with the latest version of the plugin)?

Syntax not correct for shipping rules 11 Oct 2013 15:00 #5

Condition for invoice amount below 250: Amount<250
Condition for invoice amount 250 and above: Amount>=250 (or 250<=Amount)

A very simple rule to understand < and > is that the side where the comparison operator is the space between the two lines of the > operator: The space between the two lines is larger on the left side, so the left side needs to be larger than the right side. With the < operator it is exactly the other way round: the space between the two lines is larger on the right side, so the value on the right side of the < needs to be larger than the value on the left side.

Syntax not correct for shipping rules 11 Oct 2013 15:02 #6

BTW, Uninstalling and reinstalling the plugin should not change anything about the warning (except break existing orders...)

Syntax not correct for shipping rules 24 Oct 2013 15:32 #7

  • kjw6110
  • kjw6110's Avatar
Hi

I downloaded the free plugin (thank you)as it looks as if it will do exactly what I want - VM is fairly restricted when it comes to shipping in my opinion.

I'm fairly new to this and am trying to get my head around the syntax. I have added the following in vituemart:

Name=Delivery; weight>1 & weight<30; Shipping=50
Name=Delivery; weight>30 & weight<60; Shipping=65
Name=Delivery; weight>60 & weight<90; Shipping=90
Name=Delivery; weight>90 & weight<1000; Shipping=90

My product is a fixed weight and therefore depending on the quantity ordered the shipping charge is straightforward to calculate however I get this error when I choose "shipment method" in the front end:

Evaluation yields unknown value while evaluating rule part '1 & weight'.
Evaluation yields unknown value while evaluating rule part '30 & weight'.
Evaluation yields unknown value while evaluating rule part '60 & weight'.
Evaluation yields unknown value while evaluating rule part '90 & weight'.

I don't pretend to fully know what I'm doing so any help would be greatly appreciated and apologies if this is in the wrong topic.

Thanks

Kenny.

Syntax not correct for shipping rules 28 Oct 2013 14:54 #8

The & (AND) operator is available only in the advanced version. However, your rules can be slightly re-written to work with the basic (free) plugin:
Name=Delivery; 1<weight<30; Shipping=50
Name=Delivery; 30<weight<60; Shipping=65
Name=Delivery; 60<weight<90; Shipping=90
Name=Delivery; 90<weight<1000; Shipping=90

Notice, however, that since you only use the "strictly less than" comparison (<), the bound will never match. So, a cart with a weight of exactly 30 will not match any of these rules (since 30 is neither strictly smaller or strictly larger than 30).
I think you rather want the <= operator for the upper bounds, i.e. orders of weight more than 1 and up to 30 kg (including 30kg) are 50 currenty units shipping costs.

Best regards,
Reinhold

Syntax not correct for shipping rules 28 Oct 2013 15:51 #9

  • kjw6110
  • kjw6110's Avatar
Hi Reinhold

Thanks for the reply.

I spent the weekend trying to work it out and came up with the same solution. It works perfectly.

I don't need the "<= operator" as each item we ship is 25Kg so the weight will always be a multiple thereof.

If we start shipping items with different weights I'll just purchase the advanced version but as we've just started out in business the standard one will do just fine.

I appreciate your help.

Kenny.

[SOLVED] Syntax not correct for shipping rules 28 Oct 2013 16:38 #10

Problem solved.
  • Page:
  • 1