Problem/Motivation
ShipmentWeight was recently expanded to provide a Max Weight + two new Operations in #2919113: Expand the ShipmentWeight condition to support ranges:
>= <= : Between (exclusive) and > < : Between (inclusive)
These do not however allow the admin to provide sequential weight shipping options without experiencing multiple shipping methods (or none) being provided to the user.
eg. 3x ShipmentWeight condition ship methods:
- 0 - 2kg inclusive: $5
- 2 - 4kg inclusive: $8
- 4 - 8kg inclusive: $12
To work with the existing setup, the numbers entered have to be Weight: 0kg, Max Weight: 1.9999999999kg instead of a simple Max Weight: <2kg
Switching to exclusive obviously ends up with NO shipping methods available for 2 and 4kg.
Steps to reproduce
- Install Commerce + Shipping, add products, variations, etc
- Add 3 shipping weight based methods as specified above.
- Add products to the cart such that EXACTLY 2 or 4kg is the final weight.
- 2x shipping methods provided with a significant price difference.
Proposed resolution
Add operations:
>= < : Between (>= Weight, < Max)> <= : Between (> Weight, <= Max)
Remaining tasks
None.
User interface changes
Adds 2x Operations in ShipmentWeight condition select field.
API changes
None.
Data model changes
None.
Issue fork commerce_shipping-3490977
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
elc commentedAppears tests are running against Commerce 3 and that is not currently passing tests.
This patch is working in a production site to reproduce the behaviour from the patches before the final result was merged in.
Comment #4
elc commentedUpstream tests have been fixed, so tests now pass.
Comment #6
jsacksick commentedLooks good to me, committed! Thank you!