Condition based on order subtotal instead of order total

Created on 23 January 2018, almost 7 years ago
Updated 7 April 2023, over 1 year ago

Existing condition allows store managers to create a condition that filters promotions/shipping methods/payment gateways etc. based on the order total. A useful addition would be to provide a condition that works with the order subtotal. That would allow store managers to apply a promotion when the order subtotal i.e. excluding shipping costs is greater than a certain amount.

We could implement this as a separate condition, but I have opted to add an option to the existing condition.

Feature request
Status

Fixed

Version

2.0

Component

Other

Created by

🇵🇪Peru krystalcode

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇰Denmark nicklasmf

    #11 works on my end too

  • Status changed to Needs work over 1 year ago
  • 🇨🇭Switzerland Lukas von Blarer

    The patch in #11 works for me as well.

    But I have one remaining issue. When using this for a promotion that gives a discount on the shipping fee, the promotion is only applied after saving the order. Hence when continuing in the checkout flow to the next step. This is a problem when using AJAX to recalculate shipping costs. The order totals fetched via AJAX don't apply the promotion correctly, but after clicking the "Continue" button, the promition is applied correctly.

  • 🇺🇸United States rszrama

    After reviewing this with jsacksick today in the context of a client using the patch in #7. I actually can't remember why I thought it would be better for us to have a separate condition as zaporylie implemented for us in #11. The issue I have with it in hindsight is that it's now ambiguous - which one should I be using? Is the regular "Order total" condition somehow not a current order total?

    Additionally, I think I may have introduced some scope creep in responding to bojanz re: how to accommodate different adjustment types. Sufficient for the day is its own trouble ... we could have just landed a patch that differentiated between the current order total vs. order item subtotal a while back and figured out how to further subdivide in a follow-up issue.

    I propose we go back to jsacksick's patch for now with some slight adjustment to the labels:

    Total to compare against

    1. Order total
    2. Sum of order item totals

    The point of the description is to try to make it clear what "current" means ... the problem is these conditions are used in multiple contexts, and "current" isn't terribly descriptive. Then we can create a follow-up issue to add a third option that would let us get to some sort of price + adjustments selection widget.

  • 🇺🇦Ukraine tbkot

    Added slight adjustment for label and tests

  • Status changed to Needs review over 1 year ago
  • 🇺🇦Ukraine tbkot

    Fix for failed tests

  • 🇮🇱Israel jsacksick

    One thing that was forgotten including in the patch from #7 is the schema update (commerce_order.schema.yml) we need to add the new setting there.

  • 🇮🇱Israel jsacksick

    Committed, thanks!

  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024