Allow other modules to work with the order and data post-creation, using alter hooks

Created on 1 November 2022, about 2 years ago
Updated 4 May 2023, over 1 year ago

Problem/Motivation

Other order data may be required, e.g. shipping info, and currently there isn't an easy way to do work with this data from other modules.

Proposed resolution

Include a module alter hook for the order and original data.

Remaining tasks

Review and test patch.

API changes

Extra module hook (hook_decoupled_order_alter)

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom Dubs

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.

  • 🇬🇧United Kingdom Dubs

    Hello again, I've attached a new patch, which contains two new hooks: -

    1. hook_decoupled_order_data_alter - allows the order data to be altered.
    2. hook_decoupled_order_alter - allows the order to be altered. In my case we adding a shipment to the orders.

    I've also moved the validation hook below the order_checkout_prepare hook so we can change the incoming data. In my case, the third party sends an EAN code as a lookup as opposed to the SKU, so we find the product variations that way and change the order data to have the skus instead.

  • Status changed to RTBC over 1 year ago
  • 🇬🇪Georgia iamdroid

    Hi @Dubs, Thanks for this.

    I've reviewed the patch, it has been applied smoothly, code changes look good, the module works normally, and no problems were found.

    RTBC

    • pavel.bulat committed 6238dfb2 on 8.x-1.x
      Issue #3318503 by Dubs, kalabro, iamdroid: Allow other modules to work...
  • 🇧🇾Belarus pavel.bulat

    Thank you all for working on it! I have merged the path.

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

Production build 0.71.5 2024