ShipmentWeight operations should provide left/right anchor option

Created on 2 December 2024, 2 days ago

Problem/Motivation

ShipmentWeight was recently expanded to provide a Max Weight + two new Operations in Expand the ShipmentWeight condition to support ranges RTBC :

>= <= : 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.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇦🇺Australia elc

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @elc
  • Pipeline finished with Failed
    2 days ago
    Total: 306s
    #356076
  • 🇦🇺Australia elc

    Appears 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.

  • Pipeline finished with Failed
    2 days ago
    Total: 235s
    #356087
Production build 0.71.5 2024