Problem/Motivation
We are using the stock module, and we want to be able to restrict adding of some products to the cart. We can just override the controller and copy-paste everything, but I don't like it.
Another thing is that we are using commerce_vado module. It adds a lot of complexity. It extensively uses data field in order_items. Hence we need to somehow clean up the order item cloning. It could be done in ORDER_CLONED, but as for me, it should be triggered only once and not in the loop.
Proposed resolution
Add two more events to be able to react on order item cloning and order item availability check.
| Comment | File | Size | Author |
|---|---|---|---|
| adds-order_item_availability_event_and_order_item_clone_event.patch | 5.02 KB | dinazaur |
Issue fork commerce_repeat_order-3354174
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
dinazaur commentedComment #4
seanrThis patch causes a fatal error on 2.4 in Drupal 10:
Comment #5
seanrDispatcher argument order switched at some point. Latest commit to the MR fixes.
Comment #6
neilnz commentedLGTM. Solved our product availability situation, and is backwards compatible.