smartsendio / woocommerce

Smart Send module for WooCommerce
GNU General Public License v3.0
0 stars 2 forks source link

Flat rate overrules weight limits #16

Open andershelt opened 4 years ago

andershelt commented 4 years ago

@bilfeldt We have an issue on the WooCommerce plugin when using flat rate.

If a weight limit is used on a shipping method, that limit is overruled when an end-user reaches the limit for the flat rate price.

Example for free shipping from 50DKK but weight limit on 1kg. (1 product is 0,5kg, cart totalt is there for 1,50kg) Shipping methods settings from backend image

Result on checkout when flate rate requirement is met but the weight limit for the shipping method is exceeded. image

bilfeldt commented 4 years ago

@andershelt This is intended behaviour. If you check the log, then you will see that one of the first things that are checked is whether or not free shipping should be applied, and if it should then it will not even look at the weight table.

So in this case free shipping is enabled for orders >=50 DKK and the user has a subtotal of 54 DKK hence free shipping will be enabled regardless of the weight.

Can we change this

Yes we can, but it will cause a lot of problem with our existing customers - hence this is a breaking change, and if we are to implement this, then it cannot be added before version 8.

What can this customer do

He can use the filter woocommerce_shipping_smart_send_shipping_is_available where a maximum weight can be inserted

Decision

Should we change this in an upcoming version 8?

If so, then we have two options:

  1. Free shipping is only added if a weight interval is entered (in this case 0-1kg)
  2. An extra field is added for maximum weight.

I personally prefer option 1, and I like the idea because this will make it easier to have both Varebrev and MyPack setup for example.

Example of Varebrev and MyPack

andershelt commented 4 years ago

@bilfeldt I definitely think we should change this in the next version of the WooCommerce plugin. If I was the user and had setup critierias for when a shipping method was valid, I would not expect the criterias to be overruled.

The issue as I see it is that we don't use the weight criteria when free shipping becomes active. If there is not setup any flat rate criteria, then the weight limit should still work. 0-1. So is there a 3rd option where we still use the weight limit from the table and the flat rate only works within this weight range?

Or is this option 1? Because there is always a weight interval is entered in WooCommerce. Blank fields will either give a mistake of remove the whole line.

bilfeldt commented 4 years ago

The issue as I see it is that we don't use the weight criteria when free shipping becomes active. If there is not setup any flat rate criteria, then the weight limit should still work. 0-1. So is there a 3rd option where we still > use the weight limit from the table and the flat rate only works within this weight range?

Or is this option 1? Because there is always a weight interval is entered in WooCommerce. Blank fields will either give a mistake of remove the whole line.

This is exactly my option 1 if I understand you correctly.

Using the setup from my previous comment then the shipping prices would be:

Is this how you imagine it @andershelt ?

andershelt commented 4 years ago

@bilfeldt That is exactly how I imagine it 😄