Order R-1042 after two amendments: the status messages Added Suede care kit (x1) and Balance change: +19,00 €, the warning Outstanding balance: 19,00 €. A new payment should be collected, with a Manage payments link, the items Oxford - 40, Leather belt and Suede care kit, a total of 187,00 €, and an Order activity with two entries by Marta Lopes: the item added with its reason and balance change, and the Oxford swapped from a 39 to a 40 with its SKUs and reason.
The Amend Order tab of order R-1042, with Swap item selected among Swap item, Add item, Remove item, Add coupon and Remove coupon, Oxford - 39 as the order item to change, Oxford - 40 as the new product variation, Override the unit price unticked, and the reason Customer asked for a 40, above an Apply button.

Commerce Order Amend adds an Amend Order tab to placed Drupal Commerce orders, so customer service can swap an item for another size or product, add or remove items, and add or remove coupons without editing the order by hand. Each change keeps the prices the customer paid, says how much is now owed or due back, and is recorded in the order's activity.

Features

  • 🛒 Swap, add and remove items. Swap an order item for another published variation of its product, such as another size, or for any variation with Change to a different product; add a variation with a quantity; remove an item. A swapped item keeps the unit price it was sold at, and any price can be overridden in the order's currency, zero included for a replacement given free of charge.
  • 🎟️ Add and remove coupons. A coupon is accepted when its promotion applies to the order, and a second coupon of a promotion that allows one per order is refused, as Commerce refuses them at checkout.
  • 💰 Prices kept, balance shown. Before Commerce recalculates the order, every item's unit price is locked, so a price resolver working from the back office user's country or currency changes nothing. After each amendment the order page shows the change in the total, whether a payment is due or a refund is owed, with a link to the order's payments, and anything the recalculation still changed, such as a promotion, with a link to edit the order.
  • 📊 An audit trail. Every amendment is an entry in the order's activity: who made it, the items and their SKUs, the reason given and the balance change. Orders record the kinds of amendment they went through in a field Views can filter on.
  • 🔒 Permissions and states. One permission for items and one for coupons, each opening only its own operations, on orders in the states you choose: Validation and Fulfillment by default.
  • 📦 Stock check. With Commerce Stock, a swap or an addition is refused when the new variation is short of stock, unless it is always in stock. A setting turns the check off.
  • 🔌 An event for site code. OrderAmendEvent follows every amendment with its type, the order, the item, the old and new variations, the quantity, the reason and the coupon code, for code that moves stock, updates production or notifies the customer.

 the item added with its reason and balance change, and the Oxford swapped from a 39 to a 40 with its SKUs and reason.

Quick start

composer require drupal/commerce_order_amend
drush en commerce_order_amend
  1. At Commerce > Configuration > Order Amend, tick the order states in which orders may be amended. Validation and Fulfillment come ticked; on Commerce's Default workflow, where a placed order goes straight to Completed, tick Completed.
  2. At People > Permissions, give customer service Edit order items on placed orders, Edit coupons on placed orders, or both.
  3. Open a placed order in one of those states and click its Amend Order tab.
  4. Pick an operation, fill in the details and click Apply. The order page shows the change, the balance change and a new entry in Order activity.

The Amend Order tab of order R-1042, with Swap item selected among Swap item, Add item, Remove item, Add coupon and Remove coupon, Oxford - 39 as the order item to change, Oxford - 40 as the new product variation, Override the unit price unticked, and the reason Customer asked for a 40, above an Apply button.

Swapping a size: the other sizes of the product are offered, and the reason goes into the activity log.

Good to know

  • Commerce does not recalculate a placed order by itself. The module asks it to after each amendment, with the item prices locked; promotions and taxes are calculated again, so an automatic promotion that has reached its usage limit since the order was placed is removed, and the warning says so.
  • A coupon's dates and usage limits are not checked, since Commerce checks them against the date the order was placed, and a coupon added here does not count toward its usage limits: Commerce counts a coupon's use when an order is placed.
  • The module says what to collect or refund; it takes no payment and issues no refund. Staff do that from the order's Payments tab.
  • The stock check reads the stock level and moves no stock. Moving stock between the old and the new variation is for an OrderAmendEvent subscriber.
  • Uninstalling the module deletes its entries from the activity of every order, because Commerce Log shows an entry through a template the module provides.

Additional requirements

  • Drupal 10 or 11, and PHP 8.1 or later.
  • Commerce Core 2.33 or later, or 3, with its Order, Product, Promotion and Log modules.

Recommended modules/libraries

  • Commerce Make-to-Order: when an item is swapped, its production orders still in Draft or Queued take the new variation, and for one already in production a note is logged on the Commerce order.
  • Commerce Stock: the stock check before a swap or an addition.

Community documentation

  • README: the operations, price protection, balance tracking, the activity log, coupons, permissions, the event and Views integration.

Supporting this module

Developed and maintained by Bloomidea. Bloomidea offers support and custom development for this module.

Supporting organizations: 
Development and maintenance

Project information

Releases