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 error during evaluation, RPN is not well fo 23 Sep 2013 20:58 #1

  • mattcrocker
  • mattcrocker's Avatar Topic Author
Joomla 2.5.14
Virtuemart 2.0.22c
PHP 5.3.27

Keep getting error:

Syntax error during evaluation, RPN is not well formed! (Full rule: 'OR 53000<=ZIP<=53299')
Unknown error occurred during evaluation of rule 'OR 53000<=ZIP<=53299'.

When I use this rule:
Name=Zone 6; Weight==5; 53400<=ZIP<=53599; OR 53000<=ZIP<=53299; OR 52000<=ZIP<=52899; OR 50000<=ZIP<=51599; Shipping=73.21

I may have looked at it so long I can't find the error or type... is it a PHP issue?

Syntax error during evaluation, RPN is not well fo 23 Sep 2013 21:30 #2

There should be no semicolons before the OR operators:
Name=Zone 6; Weight==5; 53400<=ZIP<=53599 OR 53000<=ZIP<=53299 OR 52000<=ZIP<=52899 OR 50000<=ZIP<=51599; Shipping=73.21

A semicolon effectively works exactly like an " AND ".

Syntax error during evaluation, RPN is not well fo 24 Sep 2013 19:24 #3

  • mattcrocker
  • mattcrocker's Avatar Topic Author
That worked perfectly... But now I have code that when I post it and save it clears the whole field and wont save...

One set of code saves the other doesn't... it is a copy and paste code with two changes... the Weight and Shipping...

Any ideas?

This code saves:
Name=Zone 7; 00500<=ZIP<=00599 OR 01000<=ZIP<=01299 OR 05200<=ZIP<=05299 OR 06000<=ZIP<=12899 OR 13000<=ZIP<=14999 OR 15500<=ZIP<=21299 OR 21400<=ZIP<=22799 OR 23000<=ZIP<=23899 OR 25400<=ZIP<=25499 OR 26700<=ZIP<=26799 OR 27900<=ZIP<=27999 OR 44400<=ZIP<=44599 OR 48400<=ZIP<=48799 OR 49600<=ZIP<=49999 OR 54500<=ZIP<=54599 OR 55600<=ZIP<=55899 OR 56500<=ZIP<=56799 OR 58200<=ZIP<=58399 OR 59000<=ZIP<=59999 OR 83300<=ZIP<=83399 OR 83500<=ZIP<=83899 OR 89400<=ZIP<=89599 OR 89700<=ZIP<=89799 OR 93400<=ZIP<=93499 OR 93600<=ZIP<=96699 OR 97500<=ZIP<=97999 OR 99000<=ZIP<=99499; Weight==20; Shipping=97.60

This code doesn't:
Name=Zone 7; 00500<=ZIP<=00599 OR 01000<=ZIP<=01299 OR 05200<=ZIP<=05299 OR 06000<=ZIP<=12899 OR 13000<=ZIP<=14999 OR 15500<=ZIP<=21299 OR 21400<=ZIP<=22799 OR 23000<=ZIP<=23899 OR 25400<=ZIP<=25499 OR 26700<=ZIP<=26799 OR 27900<=ZIP<=27999 OR 44400<=ZIP<=44599 OR 48400<=ZIP<=48799 OR 49600<=ZIP<=49999 OR 54500<=ZIP<=54599 OR 55600<=ZIP<=55899 OR 56500<=ZIP<=56799 OR 58200<=ZIP<=58399 OR 59000<=ZIP<=59999 OR 83300<=ZIP<=83399 OR 83500<=ZIP<=83899 OR 89400<=ZIP<=89599 OR 89700<=ZIP<=89799 OR 93400<=ZIP<=93499 OR 93600<=ZIP<=96699 OR 97500<=ZIP<=97999 OR 99000<=ZIP<=99499; Weight==15; Shipping=94.28

Syntax error during evaluation, RPN is not well fo 24 Sep 2013 20:58 #4

Sorry, but I can't reproduce this problem. The second rule correctly saved at demo.kainhofer.com... Can you reproduce the problem at demo.kainhofer.com?
Is this rule the only rule in the field, or just one of many? Which countries have you selected for that rule? What's the number of the country zone (i.e. is it the last country zone on the config page?).

Reinhold

Syntax error during evaluation, RPN is not well fo 24 Sep 2013 21:47 #5

  • mattcrocker
  • mattcrocker's Avatar Topic Author
I have to split up the rules into multiple fields... Once I get to a certain spot of number of characters or something when i hit save it all disappears... I haven't forund any patters... did the same with the free version so I bought the paid version and same thing...

Don't see a log in for the demo backend...

All countries...

Its not the code it is something with the number of entries or characters or php 5.3 maybe...

Joomla 2.5.14
Virtuemart 2.0.22c
PHP 5.3.27

Syntax error during evaluation, RPN is not well fo 24 Sep 2013 22:11 #6

Ah, okay, you might hit a MySQL field size restriction (or a VM restriction on the length of the fields).

BTW, another thing I encountered is that rules are not allowed to contain the pip character (a "|"), because then the whole field will be truncated there (the reason is that VM internally uses that character to split up the custom field parameters).

Thanks for the hint about the mising login data for the demo server. Apparently, someone thought it would be fun to remove the front page text... I have restored the front page with the login data.

Syntax error during evaluation, RPN is not well fo 26 Sep 2013 22:15 #7

  • mattcrocker
  • mattcrocker's Avatar Topic Author
You have been amazing answering these question... Last one I hope.

Product A has a drop down with 5 different weights. I need to be able to get the weight or number of articles to the Advanced Shipping by Rules plugin... 5 pounds = 1 article, 10 pounds = 2 articles etc...

Do I first I need to figure out how to get that into the drop down or is it there and I can pass to you plugin???

Product A, Weight = 5 Amount = 5.00 (1 Article)
Product A, Weight = 10 Amount = 10.00 (2 Article)
Product A, Weight = 15 Amount = 15.00 (3 Article)

Product B, Weight = 5 Amount = 10.00
Product B, Weight = 10 Amount = 20.00
Product B, Weight = 15 Amount = 30.00

Visitor wants to buy 1 product A at 10 lbs (2 articles) and 2 product B at 15 lbs. (3 articles). That gets passed along with zip code to come up with a price...

Am I even making sense?

Thank you for your help

Syntax error during evaluation, RPN is not well fo 28 Sep 2013 22:26 #8

How are you creating those dropdowns for the weights?

My plugin simply gets the contents of the cart and extracts the weights that each product in the cart has assigned. If your dropdown correctly assigns the new weight to the product, the plugin should work out of the box. If it doesn't, I don't see a way for the plugin to extract the data.

Syntax error during evaluation, RPN is not well fo 08 Oct 2013 18:23 #9

  • mattcrocker
  • mattcrocker's Avatar Topic Author
Ok, figured out how to make it work... but when I paste in the rules... once I get over 18161 characters... split up into different fields it won't save... well it saves but deletes what I put in those fields.. just adding one more line kills it...

Same issue as

www.open-tools.net/forum/shipping-by-rul...t-save-properly.html

Joomla 2.5.14
Virtuemart 2.0.22c
Database 5.5.30-30.2
PHP 5.3.27

Where in the database are the shipping rules stored? Maybe I can manually post them there...

Any ideas?

Syntax error during evaluation, RPN is not well fo 09 Oct 2013 18:35 #10

  • mattcrocker
  • mattcrocker's Avatar Topic Author
I think it may be the length of the rules... is there another way to put this rule that would be shorter?

Name=Shipping to Zone 6; Articles==3; 93500<=ZIP<=93599 OR 93000<=ZIP<=93399 OR 91000<=ZIP<=92899 OR 90000<=ZIP<=90899 OR 89800<=ZIP<=89899 OR 89300<=ZIP<=89399 OR 88900<=ZIP<=89199 OR 86400<=ZIP<=86499 OR 84000<=ZIP<=84799 OR 83400<=ZIP<=83499 OR 82000<=ZIP<=83299 OR 81500<=ZIP<=81699 OR 80500<=ZIP<=80599 OR 80300<=ZIP<=80399 OR 69100<=ZIP<=69399 OR 68600<=ZIP<=68799 OR 68000<=ZIP<=68199 OR 62400<=ZIP<=62799 OR 60000<=ZIP<=61999 OR 58400<=ZIP<=58499 OR 58000<=ZIP<=58199 OR 57000<=ZIP<=57799 OR 55900<=ZIP<=56499 OR 55300<=ZIP<=55599 OR 53700<=ZIP<=54499 OR 53400<=ZIP<=53599 OR 53000<=ZIP<=53299 OR 52000<=ZIP<=52899 OR 50000<=ZIP<=51599 OR 48800<=ZIP<=49599 OR 47800<=ZIP<=48399 OR 44600<=ZIP<=47599 OR 43000<=ZIP<=44399 OR 42500<=ZIP<=42799 OR 40000<=ZIP<=41899 OR 37600<=ZIP<=37999 OR 34900<=ZIP<=34999 OR 34700<=ZIP<=34799 OR 33800<=ZIP<=34199 OR 32700<=ZIP<=33499 OR 32000<=ZIP<=32299 OR 31300<=ZIP<=31599 OR 30800<=ZIP<=30999 OR 30400<=ZIP<=30699 OR 28000<=ZIP<=29999 OR 27000<=ZIP<=27899 OR 26800<=ZIP<=26899 OR 25500<=ZIP<=26699 OR 23900<=ZIP<=25399 OR 22800<=ZIP<=22999 OR 15000<=ZIP<=15499; Shipping=87.17

I have this rule for Each number of Articles up to 10 with different prices...

maybe something like

Name=Shipping to Zone 6; 89300<=ZIP<=89399 OR 88900<=ZIP<=89199 OR 86400<=ZIP<=86499 OR 84000<=ZIP<=84799; (Articles==3; Shipping=87.17) OR (Articles==4; Shipping=90.00) OR (Articles==5; Shipping=95.00)

????

Syntax error during evaluation, RPN is not well fo 09 Oct 2013 19:17 #11

  • mattcrocker
  • mattcrocker's Avatar Topic Author
Figured it out...

changed the mysql database --> virtuemart_shipmentmethods --> shipment_params --> to mediumtext utf8_general_ci

Works now...

Syntax error during evaluation, RPN is not well fo 11 Oct 2013 15:04 #12

Unfortunately, I don't see an easier way to write these rules themselves.
However, depending on what you want for the other postal codes to happen, you might be able to exploit the way the plugin evaluates the rules. In particular, let's assume you have two simple rules. The plugin will evaluate one rule after the other and as soon as one rule matches, it will be used. In other words: If the second rule is ever evaluated, you know that the conditions of the first rule have not matched.

So, if you don't want to provide any shipping for all other postal codes, you can use a first rule like:
Name=Exclude certain postal codes from shipping; ZIP<15000 OR 15500<=ZIP<22800 OR ....; NoShipping
For all other rules in that country zone you can then safely assume that the ZIP variable has one of the valid values and you don't have to explicitly check it in each rule again.

Of course, if you have ten different weight-based shipping costs for the other ZIP values, too, then I don't see any way to simplify the rules.

Syntax error during evaluation, RPN is not well fo 11 Oct 2013 15:18 #13

Thanks for the tip, I'm in discussion with the other VM developers about whether we can or should change the database layout for the shipping_params.
  • Page:
  • 1