Allow coupons added to order (when not in draft) to apply the corresponding promotion

Created on 18 March 2020, almost 5 years ago
Updated 7 May 2023, over 1 year ago

Hello,

If you change the coupons associated with the order on the edit order page, the order adjustments and the order items adjustments aren't updated to reflect the changes made on the order.

Is this a bug or a feature request?

Feature request
Status

Active

Version

2.17

Component

Order

Created by

🇵🇹Portugal introfini

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.

  • 🇳🇴Norway zaporylie

    There are some severe implications connected to this feature request

    1. If order were to be refreshed - the price resolver may resolve different price, different promotions can apply, tax rate can change, etc. This will impact the entire order.
    2. Applying promotion typically results in price change. Price change calls for adjustment of the tax adjustment
    3. Non-draft orders, especially orders in the final state (state_machine) should be considered immutable. If they are not, the list of allowed option should be curated and implemented on per case basis.

    I think this issue boils down to an UX issue - order edit form should not expose the coupon code field.

  • 🇵🇹Portugal introfini

    @zaporylie You are completely correct; this is simply a UX/UI issue that could be improved.

  • 🇳🇴Norway zaporylie

    Updated issue title and summary in connection with #6 and #7

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    781 pass
  • 🇳🇴Norway zaporylie

    Here's a patch that changes default field display options.

  • 🇮🇱Israel jsacksick

    I don't like this fix, you could still edit a draft order? And the coupon would be applied. Additionally on several projects I need to manually re-apply coupons on placed orders, I then have custom scripts that trigger a slightly modified version of the order refresh that doesn't involve the price recalculation.

  • 🇩🇪Germany Anybody Porta Westfalica

    @jsacksick I think the points made in the issue summary are correct. Which fix would you find useful here? So maybe we could proceed fixing this. (I also don't like the approaches from patches here)

  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇮🇱Israel jsacksick

    Yep, no problem around making the coupons field configurable...

Production build 0.71.5 2024