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:

Shipping Rules 18 Oct 2016 00:17 #1

  • dkaneloglou
  • dkaneloglou's Avatar Topic Author
Hello,
I have installed the Shipping by Rules plugin.
I found it excelent and perfect idea! Congruts!
I have some questions though,I need to do some calculations a little bit complicated in our eshop.
For the shippment in Greece when the total weight of the products is under 2 kilos, the shipping cost is 3 euros.
Above 2 kilos for every extra kilo the extra cost is 0.90/kg until 9 kilos and 0.70/kg above.
In all cases, if the total amount is up to 42euros the sippping cost is FREE.
Is it possible?

I started to write this rule:
Name=ACS Standard; Weight<=2; Shipping=3
Name=ACS Standard; 2<Weight<=3; Shipping=3.9
Name=ACS Standard; 3<Weight<=4; Shipping=4.8
Name=ACS Standard; 4<Weight<=5; Shipping=5.7
.....
....on and on and on
...
until where do I stop¿?

I am not sure if this is correct. I should stop at some point, on some weight. But what if some customer orders more products (more weight)?

I am sure there must be something more mathematically correct..
Could you please help me with the rules I have to apply?
Thank you in advance!

Shipping Rules 18 Oct 2016 01:34 #2

Dear Dorothea,
You are absolutely right with your doubts about when to stop the rules. In the free version of the plugin, no mathematical expressions are supported, so you can only give fixed bounds, and you must explicitly list each kg range. Of course, you customer can always make an order that is just a little heavier than the highest weight that you gave in your last rule...

With the advanced (i.e. paid) version of the plugin, you can easily write these rules using a formula:
Name=ACS Standard - Free Shipping; Amount>=42; Shipping=0
Name=ACS Standard; Weight<=2; Shipping=3
Name=ACS Standard; 2<Weight<=9; Shipping=3+ceil(Weight-2)*0.9
Name=ACS Standard; 9<Weight; Shipping=3+7*0.9+ceil(Weight-9)*0.7

Best regards,
Reinhold

Shipping Rules 18 Oct 2016 15:54 #3

  • dkaneloglou
  • dkaneloglou's Avatar Topic Author
Thank you! I am glad I know it is possible to do this!
Can you please tell me, where do I perchase the paid version? I only see one download arrow in the page.
Also I wonder if the weight calculates the total weight in the cart?
There are products that the weight are in onz, but the shipping in all products have to be calculated in kg. Does it converted automaticaly?

Shipping Rules 21 Oct 2016 14:22 #4

  • dkaneloglou
  • dkaneloglou's Avatar Topic Author
Hello again,

can you please explain what do you calculate here 3+7*0.9+ceil(Weight-9)*0.7?
I am lttle confused. What ceil means?

Also in a particular country I want shipping cost 3,5euros until 2kilos and every extra kilo 1euro extra charge.
I bought the advanced Shipping by rule to write the rule:
Name=Your order is {weight}kg. ACS NET 2; Weight<=2; Shipping=3.5
Name=Your order is {weight}kg. ACS NET 2; 2<Weight; Shipping=3.5+ceil(Weight-2)*1
The weight of some products I have in the cart is 2.551455kg I wonder, can it be rounded at 2.5?
The shipping cost is 4.5, I suppose it is correct as the company will charge 3kilos! :)

Also in another country the extra cost of 1euro will be at every extra 0.5kilo, instead of 1kilo, how do I apply the rule?

Thank you in advance!

Shipping Rules 22 Oct 2016 22:59 #5

"ceil" is a function that rounds up to the next whole number ("ceil" is shorthand for ceiling), so e.g. ceil(7.8) returns 8, while ceil(7) returns 7 (as 7 is already a whole number).

The individual terms of 3+7*0.9 + ceil(Weight-9)*0.7 mean the following:
-) The first 2kg are 3 Euro (the first term)
-) The next 7kg (each kg above 2, up to 9kg) are 0.9 Euro each, so 7*0.9 in total
-) Finally, each kg above 9kg is charged 0.7 Euro. Weight-9 is the weight exceeding 9kg, eg. 9.45 kg is 0.45 kg above 9kg. For this 0.45kg a full kg is charged, so we round it up to the next whole kg, which is exactly what ceil is doing.

To charge 1 Euro for every 0.5kg, you can simply multiply the weight by 2 and handle it similarly to the 1 Euro/kg case. Or you can first round up to the next 0.5kg and then multiply by 2:
Name=1 Euro per 1/2 kg above 3kg; Shipping=ceil(2*(Weight-3))
or equivalently:
Name=1 Euro per 1/2 kg above 3kg; Shipping=2*ceil(Weight, 0.5)-6

Regarding your request how to round the weight for display: You'll have to define a custom variable that stores the weight rounded to a given accuracy, e.g. rounded to the next 0.1 step. Note, however, that 2.551455 will be rounded to 2.6! Also, since you charge 1 Euro for each additional kg, ie. 2.01 will still count as 3 kg, you should not round to the nearest 0.1 kg step, but rather always round UP to the next 0.1kg step:
Variable=RoundedWeight; Value=ceil(Weight, 0.1)
Name=Your Order is {RoundedWeight}kg. ACS Net 2; ...

Best regards,
Reinhold

Shipping Rules 29 Nov 2016 00:56 #6

  • dkaneloglou
  • dkaneloglou's Avatar Topic Author
Hello,
I used and changed the above code so I wrote this:

Name= - Zone 2 - Delivery 2-4 days. Weight: {weight}kg. ; Weight<=0.5; Shipping=39.60
Name= - Zone 2 - Delivery 2-4 days. Weight: {weight}kg. ; 0.5<Weight;
Shipping=39.60+10*2*(ceil(Weight,0.5)-0.5)

I am almost sure it was working..
Now I updated to 6.1.7 and I get an error:
when I have more than 500gr in the cart
Unknown rule type '' encountered for rule 'Name= - Zone 2 - Delivery 2-4 days. Weight: {weight}kg. ; 0.5
What am I doing wrong??

what I need is 39,60euro for the first 0.5kilo
and for every 0.5kilo extra charge 10euro.

Thank you!

Shipping Rules 30 Nov 2016 11:32 #7

  • dkaneloglou
  • dkaneloglou's Avatar Topic Author
Joomla version 3.6.4
Advanced Open Tools 6.1.7

Shipping Rules 30 Nov 2016 12:18 #8

  • dkaneloglou
  • dkaneloglou's Avatar Topic Author
test please make an order from Iceland
shop.nutritionglobaltrading.com/en/

Shipping Rules 09 Dec 2016 21:56 #9

Dear Dkaneloglou,
Sorry for the late reply.
About your error: To me it looks like the second and third lines should actually be one line with no line break before the shipping.
The error message says that the second rule does not have any type, ie. it does not specify shipping costs (no Shipping=..., no NoShipping) and also does not define a variable or extra shipping charges.

If you remove the linebreak before the Shipping=... on the third line, things should work.

Best regards,
Reinhold
  • Page:
  • 1