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:

Sipping by Country - city - Product packaging m3 23 May 2013 20:48 #1

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi to all


I want to apply a rule by Country - city - Product packaging m3

Your help are very well come

Many Thanks

Sipping by Country - city - Product packaging m3 24 May 2013 19:26 #2

Do I understand you correctly that you want the shipping costs to depend on the ZIP and on the total volume of the order (i.e. the individual volumes of all products added)?
That can be easily done using conditions with the ZIP and the TotalVolume variables.

On the other hand, there is no way to calculate the dimensions of the box for shipping, because that is a mathematically hard problem (and it depends on other things, like the available boxes having only certain dimensions).

Sipping by Country - city - Product packaging m3 24 May 2013 19:44 #3

  • vdimeris
  • vdimeris's Avatar Topic Author
Sorry my mistake


I want to calculate the shipping cost depend:
1: zip
2: volume of order (as you describe)
3: Product Packaging in Cubic meters iso Weight of product

MY costumer have solve the issue with dimensions and have all ready The Product Packaging in Cubic meters in the product VM fields.

Many Thanks for your support

Sipping by Country - city - Product packaging m3 27 May 2013 09:29 #4

Do I understand you correctly that your customer somehow calculates the dimensions of the shipping box with some other plugin and stores it in some order property?
It is currently not possible to access sich other order properties other than the ones listed in the documentation (www.open-tools.net/documentation/shippin...emart.html#variables ).

So, for now your case cannot be solved with my plugin.

But if you can give me a little more detail how the packaging dimensions are calculated and stored, I might get an idea how to extend the plugin in the future to support custom order properties...

Thanks, Reinhold

Sipping by Country - city - Product packaging m3 27 May 2013 10:00 #5

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi Reinhold

Please correct me if I'm wrong on the below !!!

They are not use any other plugin to make the calculation (may be they are use excel or any other program to do this, external from VM)

In my case the shop are furniture and the company knows the packaging Product Dimensions before sending to the client so they are calculate the dimensions and they are have the Product Packaging in Cubic meter, which are filled up in VM field Product Packaging and select Cubic meter.
May be we can add a variable for this field???

I don't know if this is clear but if you want I can give you access to site backend.

Many Thanks/Best Regards

Vagelis

Sipping by Country - city - Product packaging m3 15 Jun 2013 12:11 #6

If I understand you correctly (the vendor calculates the box dimensions and then modifies the existing order), then unfortunately this cannot be done, because the shipment plugin does its work when the user enters the order. So the shipping cost will be long determined before the vendor enters the boxing dimensions.

Sipping by Country - city - Product packaging m3 16 Jun 2013 12:39 #7

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi

The box dimensions is prefixed (That means when the vendor create the product in VM2 they already know the dimensions. Let me do it simple. Every product has own box (You don't have small products which are putting all together in a bigger box and so on... in order to recalculate the dimensions of new box).

Example (in my case):

Product Dimensions (see attachment)


As you can see the only field is the product dimension in Cubic meter.

What exactly I need is:
if user add to cart 2,3,4, products I have to add the Product Dimensions field for every product and if the sum of Cubic meter is 1 then charge 18euros ( if 2 then the charge should be 36euros, minimum 18euros if cubic meter is less than 1.

Filters must be Country and zip code

I hope this is much clear than before

Many Thanks
Attachments:

Sipping by Country - city - Product packaging m3 18 Jun 2013 19:55 #8

Ah, thanks for the clarification...

So all you would need is the sum of all product packaging values of all the products in the cart. Currently that's not possible, but I will add variables TotalPackaging, MinPackaging and MaxPackaging to the next version 3.0.0 (which will be released in the next few weeks)

Sipping by Country - city - Product packaging m3 19 Jun 2013 09:27 #9

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi

I'm very glad to help you with this in order to expand your product... and at the end make my job easier.

I will appreciate to let me know when you release the next version.

Again many thanks

Sipping by Country - city - Product packaging m3 19 Jun 2013 15:00 #10

Version 3.0.0 is now available, which adds the following features:
-) Functions like round(..), ceil(...), max(...), min(...)
-) New variables TotalPackaging, MinPackaging and MaxPackaging
-) Variable substitutions in the rule names: {varname} will be replaced by the value

Sipping by Country - city - Product packaging m3 19 Jun 2013 15:03 #11

  • vdimeris
  • vdimeris's Avatar Topic Author
You really fast !!!!

THANK YOU !!!

Sipping by Country - city - Product packaging m3 19 Jun 2013 15:13 #12

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi I have a small problem

In my download sections does not accept my order number and secret key ?

Any Idea?

Sipping by Country - city - Product packaging m3 19 Jun 2013 22:47 #13

AFAICS, you have not bought the plugin on my site... Did you buy it through extensions.virtuemart.net? If so, you'll need to way a bit until Valérie updates the file there... I have sent it to her, but it will take a litle bit for her to upload it. Unfortunately, I can't do it myself, since I don't have any editing rights on EVN.

Sipping by Country - city - Product packaging m3 19 Jun 2013 23:44 #14

  • vdimeris
  • vdimeris's Avatar Topic Author
You are fully right it was viaextensions.virtuemart.net

Ok I will wait ...

Thnaks

Sipping by Country - city - Product packaging m3 23 Jun 2013 17:23 #15

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi

I just install the new version 3.0.0 but unfortunately I have white screen when I'm truing to access It

Any idea ???

Thanks

Sipping by Country - city - Product packaging m3 23 Jun 2013 17:44 #16

Am I right that you have PHP 5.3 installed? All my tests with PHP 5.4 worked great, but I didn't have a PHP 5.3 test system available.

It appears that PHP 5.3 does not like calls like getdate(), but rather requires the getdate() return value to be stored in a local variable first. I have updated the plugin to version 3.0.1, which should fix this problem.

Sipping by Country - city - Product packaging m3 23 Jun 2013 18:33 #17

  • vdimeris
  • vdimeris's Avatar Topic Author
Yep ...

You are right.. My hosting provider still using PHP 5.3 for the time being..

Thanks for the update

Best Regards

Sipping by Country - city - Product packaging m3 06 Jul 2013 20:15 #18

No problem, the latest version will work with PHP 5.3.

Sipping by Country - city - Product packaging m3 09 Jul 2013 17:17 #19

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi again

I have a question and I need your lights !!!

My customer Shop located in Greece and sale for the time been only in Greece.

He shipping (with cost shipping) only in one Area of Greece (because he has only an agreement for this area)

My question here is :
What is the best practice for the above ???

Many Thanks for your help because I have stuck

Sipping by Country - city - Product packaging m3 12 Jul 2013 13:55 #20

Can this area of Greece be easily described by postal code restrictions?
If so, you can use conditions on the ZIP variable (if no rule matches, no shipping rate will be offered).

Or do you have any other way to define to which addresses shipping should be allowed?

Sipping by Country - city - Product packaging m3 14 Jul 2013 10:19 #21

  • vdimeris
  • vdimeris's Avatar Topic Author
Great !!!!

Because the Zip codes is around a thousand...

Million Thanks

[SOLVED] Sipping by Country - city - Product packaging m3 14 Jul 2013 10:19 #22

  • vdimeris
  • vdimeris's Avatar Topic Author
Problem solved.

Sipping by Country - city - Product packaging m3 18 Aug 2013 12:10 #23

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi Reinhold

I have apply the below rules but unfortunately does not match the zip code... Where I'm wrong

Many Thanks


MaxPackaging<=1.0000; Shipping=18
1.0000<=MaxPackaging<=2.0000; Shipping=18*2
2.0000<=MaxPackaging<=3.0000; Shipping=18*3
3.0000<=MaxPackaging<=4.0000; Shipping=18*4
4.0000<=MaxPackaging<=5.0000; Shipping=18*5
5.0000<=MaxPackaging<=6.0000; Shipping=18*6
6.0000<=MaxPackaging<=7.0000; Shipping=18*7
7.0000<=MaxPackaging<=8.0000; Shipping=18*8
8.0000<=MaxPackaging<=9.0000; Shipping=18*9
9.0000<=MaxPackaging<=10.0000; Shipping=18*10
10.0000<=MaxPackaging<=11.0000; Shipping=18*11
11.0000<=MaxPackaging<=12.0000; Shipping=18*12
12.0000<=MaxPackaging<=13.0000; Shipping=18*13
13.0000<=MaxPackaging<=14.0000; Shipping=18*14
14.0000<=MaxPackaging<=15.0000; Shipping=18*15
15.0000<=MaxPackaging<=16.0000; Shipping=18*16 AND
Name=Metaforika; ZIP==19600 OR ZIP==19200 OR ZIP==19300 OR ZIP==13451 OR ZIP==14234 OR ZIP==13231 OR ZIP==13676 OR ZIP==12351 OR ZIP==18863 OR ZIP==14343 OR ZIP==14123 OR ZIP==15121 OR ZIP==14671 OR ZIP==14578 OR ZIP==14572 OR ZIP==15237 OR ZIP==15452 OR ZIP==15451 OR ZIP==15669 OR ZIP==15235 OR ZIP==15127 OR ZIP==11145 OR ZIP==11254 OR ZIP==18233 OR ZIP==17778 OR ZIP==16777 OR ZIP==16673 OR ZIP==16672 OR ZIP==16671 OR ZIP==18648 OR 13341<=ZIP<=13345 OR 13121<=ZIP<=13123 OR 12461<=ZIP<=12462 OR 13671<=ZIP<=13677 OR 18120<=ZIP<=18122 OR 12241<=ZIP<=12244 OR 13561<=ZIP<=13562 OR 14341<=ZIP<=14342 OR 14451<=ZIP<=14452 OR 14121<=ZIP<=14122 OR 14561<=ZIP<=14564 OR 15122<=ZIP<=15126 OR 11146<=ZIP<=11147 OR 15561<=ZIP<=15562 OR 15771<=ZIP<=15773 OR 18755<=ZIP<=18758 OR 18450<=ZIP<=18454 OR 18344<=ZIP<=18346 OR 17671<=ZIP<=17676 OR 17121<=ZIP<=17124 OR 17234<=ZIP<=17237 OR 17236<=ZIP<=17237 OR 16231<=ZIP<=16233 OR 15341<=ZIP<=15343 OR 17236<=ZIP<=17243 OR 17561<=ZIP<=17564 OR 17455<=ZIP<=17456 OR 16341<=ZIP<=16346 OR 16451<=ZIP<=16452 OR 16561<=ZIP<=16562 OR 16672<=ZIP<=16675 OR 16121<=ZIP<=16122 OR 12131<=ZIP<=12137 OR 14231<=ZIP<=14235 OR 15231<=ZIP<=15238 OR 18531<=ZIP<=18547 OR 10431<=ZIP<=10447 OR 10551<=ZIP<=10564 OR 10671<=ZIP<=10678 OR 11255<=ZIP<=11257 OR 11361<=ZIP<=11365 OR 11471<=ZIP<=11476 OR 11523<=ZIP<=11528 OR 11741<=ZIP<=11745 OR 11521<=ZIP<=11522 OR 11851<=ZIP<=11855 OR 11141<=ZIP<=11145 OR 10679<=ZIP<=10683 OR 11251<=ZIP<=11255; Shipping=MaxPackaging

Sipping by Country - city - Product packaging m3 23 Aug 2013 16:24 #24

In the 15.0000<=MaxPackaging line there is an additional "AND" at the end of the line. The VM backend will tell you about that problem.

Once you remove that spurious "AND", the Metaforika rule applies without problems when the ZIP matches (and MaxPackaging is larger than 16, because otherwise one of the earlier rules has already matched).

Best regards,
Reinhold

Sipping by Country - city - Product packaging m3 23 Aug 2013 18:02 #25

  • vdimeris
  • vdimeris's Avatar Topic Author
Ok I remove the "AND"

so for each MaxPackaging I need to apply the same zip codes if I want a different shipping prices is that correct ???

Sipping by Country - city - Product packaging m3 24 Aug 2013 10:18 #26

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi Reinhold

Let me write my case and I'm trying to do....

Actually is a three parameters

1) Depending the zip code (example above) the shipping cost calculated with MIN - MaxPackaging .
if the Packaging is between 0 - 1 the shipping cost is 18euro (only for specific zip codes)... If the packaging is between 1-2 then the shipping cost is 18*2 and so on

2) I have three different cost per zip codes 18euro 22euro and 28euro

3) If the zip code does not much the no shipping offer...

Once again million thanks for your help

Sipping by Country - city - Product packaging m3 26 Aug 2013 14:28 #27

Okay, so to get a good set of rules, let's rearrange your conditions:
1) If the ZIP does not match certain conditions, then don't offer shipping at all.
2) Otherwise, the shipping is calculated from the MaxPackaging (rounded up to the next integer)

You can use the fact that once a rule matches, all further rules are ignored. So, if you check for some ZIP conditions in the first rule, then in the second rule you know that these conditions do not match, so you don't have to check those conditions in the second rule any more.

Here's what I would use for the rules:
Name=Exclude some ZIP areas; ZIP!=1600 AND ZIP!=1900 AND ...; NoShipping
Name=18€ per MaxShipping unit; Shipping=18*max(ceil(MaxShipping),1)
Note that the first rule excludes all disallowed ZIP codes, so all other rules will only be checked if the ZIP code is one of the allowed values.
The second rule calculates the shipping costs for the allowed ZIP values as 18€ per MaxShipping unit (rounded up to the next full integer, but at least 1).

If you want different rates (18, 22, 28€) for different allowed ZIP areas, then you can add those ZIP conditions to the second rule (and copy and adjust it for the 22 and 28€ areas).

Best regards,
Reinhold

Sipping by Country - city - Product packaging m3 27 Aug 2013 11:23 #28

  • vdimeris
  • vdimeris's Avatar Topic Author
Thanks Reinhold

I will try it and I will keep you posted

Vagelis

Sipping by Country - city - Product packaging m3 27 Aug 2013 17:33 #29

  • vdimeris
  • vdimeris's Avatar Topic Author
Reinhold

I receive this error

Evaluation yields unknown value while evaluating rule part 'ZIP!'.
Evaluation yields unknown value while evaluating rule part 'ZIP!'.
Evaluation yields unknown value while evaluating rule part 'ZIP!'.
Evaluation yields unknown value while evaluating rule part 'MaxShipping'.

and I have apply this :

Name=Exclude some ZIP areas; 10009<=ZIP!<=14567 AND 14570<=ZIP!<=14573 AND 14577<=ZIP!<=15235 AND 15237<=ZIP!<=15343 AND 15345<=ZIP!<=15348 AND 15352<=ZIP!<=19001 AND 10009<=ZIP!<=14576 AND 19017<=ZIP!<=19399 AND 19401<=ZIP!<=19499 AND 19501<=ZIP!<=85900 AND ZIP!=15350 AND ZIP!=19002 AND ZIP!=19006 AND ZIP!=19007 AND ZIP!=19008 AND ZIP!=19011 AND ZIP!=19012 AND ZIP!=19014 AND ZIP!=19015 ; NoShipping
Name=18€ per MaxShipping unit; Shipping=18*max(ceil(MaxShipping),1)


The ZIP is with "!" or with out ???

Vagelis

Sipping by Country - city - Product packaging m3 31 Aug 2013 12:54 #30

  • vdimeris
  • vdimeris's Avatar Topic Author
Reinhold

Found the error with ZIP it was my mistake !!!

and I have apply this:

Name=Exclude some ZIP areas; ZIP!=15344 AND ZIP!=15349 AND ZIP!=14569 AND ZIP!=19016 AND ZIP!=15344 AND ZIP!=19010 AND ZIP!=19001 AND ZIP!=19400 AND ZIP!=14568 AND ZIP!=4569 AND ZIP!=19500 AND ZIP!=19003 AND ZIP!=15351 AND ZIP!=19009 AND ZIP!=14574 AND ZIP!=19004 AND ZIP!=14575 AND ZIP!=15236 AND ZIP!=19005 AND ZIP!=19013 AND ZIP!=9003 AND ZIP!=14576 AND ZIP!=15344; NoShipping
Name=18€ per MaxPackaging unit; Shipping=18*max(ceil(MaxPackaging),1)

Ok the strange thing now..
If I use one of the above zip code then the rule applies 18€
if not one of the above zip codes NoShipping offered...

If the MaxPackaging is more than 1 the the rule still applies 18€

Thanks in advance
vagelis

Sipping by Country - city - Product packaging m3 02 Sep 2013 01:14 #31

Are you sure that MaxPackaging really has a value larger than 1? You can insert {MaxPackaging} into the name of the rule to see the actual value of the MaxPackaging variable...

Best regards,
Reinhold

Sipping by Country - city - Product packaging m3 03 Sep 2013 12:13 #32

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi Reinhold

You are fully right !!! it returns 0.0012 etc....

So I'm starting over with your rule. (I'm going to crazy...)

Now starting over I receive this error (Evaluation yields unknown value while evaluating rule part 'MaxShipping'.)


I fully understand your logic behind but I have a questions?

Supposed I have to change the 1 to 0.0001 ? And I believe that if I have a multiple products in my cart it gives a sum of products, is that correct?

Many Thanks for your patience, I'm not so good with math ...

Vagelis

Sipping by Country - city - Product packaging m3 17 Sep 2013 14:17 #33

'MaxShipping' is not a variable name that is provided by the plugin, thus the warning. I think you mistyped and rather wanted 'MaxPackaging'?

The MaxPackaging will not give the sum of the values of all ordered products, but will only give the largest Packaging value assigned to any of the products in the cart. If you want the sum of all Packaging values, you can use the variable 'TotalPackaging'.

E.g. you have one unit of product A with Packaging=3 and one unit of product B with Packaging=1, then 'MaxPackaging' will be 3 (=max(3,1)), 'TotalPackaging' will be 4 (=3+1).

Best regards

Sipping by Country - city - Product packaging m3 17 Sep 2013 16:24 #34

  • vdimeris
  • vdimeris's Avatar Topic Author
Now I can see the light at end of the tunnel -:)

So the rule should be (if I'm correct):

Name=22€ per unit; Shipping=22*max(ceil(TotalPackaging),1)

Sipping by Country - city - Product packaging m3 19 Sep 2013 13:09 #35

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi Reinhold

Ok I finally manage it !!!

Just one thing, Could you please let me know if that is correct or happen only to me???

If I add more that one product in cart I take the total of Packaging, (which is correct), If you add one product and increase the QTY it returns the same value

Thanks

Sipping by Country - city - Product packaging m3 19 Sep 2013 16:34 #36

  • vdimeris
  • vdimeris's Avatar Topic Author
I have one more problem

it reads only the first rule !!! any idea ??

Sipping by Country - city - Product packaging m3 20 Sep 2013 22:49 #37

The totalpackaging variable should calculate the values with the quantity of the products in the cart... (At least that's what the source code of the plugin says...)

Sipping by Country - city - Product packaging m3 20 Sep 2013 22:50 #38

The plugin will check the rules until it finds one where all conditions are met. All other rules are not checked any more (since in VirtueMart, each shipping method can only return at most one shipping cost).

Sipping by Country - city - Product packaging m3 21 Sep 2013 11:53 #39

  • vdimeris
  • vdimeris's Avatar Topic Author
Hi Reinhold

I found it !!! it was my mistake !!!

Everything works perfect !!!

Million Thanks for your help
  • Page:
  • 1