Phone Orders For WooCommerce

ATUM Multi-Inventory

ATUM Multi-Inventory extends ATUM Stock Manager with the ability to split a product’s stock across multiple inventory locations. When WooCommerce fulfils an order, ATUM Multi-Inventory assigns order quantities to specific inventories and stores that mapping in order item meta. When an agent creates an order through Phone Orders for WooCommerce, the standard checkout flow bypasses the $_POST population that ATUM Multi-Inventory expects — so the inventory assignment never fires and stock doesn’t deduct correctly from the right location.

This single-action snippet re-populates $_POST with the correct inventory quantity data immediately after Phone Orders processes the checkout, giving ATUM Multi-Inventory the input it needs to assign stock correctly.


Code Sample

Add the following snippet to your child theme’s functions.php or the Code Snippets plugin:

Code Explained (for Developers)

ElementDescription
woocommerce_checkout_phone_order_processedA Phone Orders action that fires immediately after an order creates through the Phone Orders checkout process. At this point the order exists in the database with all its line items, making the item IDs available for inventory lookup.
class_exists( 'AtumMultiInventory\Models\Inventory' )Confirms ATUM Multi-Inventory is active before calling any of its methods. If the plugin is absent or deactivated, the action exits cleanly.
$order->get_items()Retrieves all line item objects from the newly created order. Each item carries an ID that ATUM Multi-Inventory uses to look up inventory assignments.
Inventory::get_order_item_inventories( $item->get_id() )Calls ATUM Multi-Inventory’s static method that returns all inventory assignments for a given order item — each carrying an inventory_id (which location) and qty (how many units from that location).
$oi_inventory_qty[ $item->get_id() ]Builds a nested array mapping each order item ID to its inventory assignments. ATUM Multi-Inventory reads this structure from $_POST['oi_inventory_qty'] during its stock deduction process.
$_POST['oi_inventory_qty'] = $oi_inventory_qtyPopulates the $_POST key ATUM Multi-Inventory listens for. Injecting it here allows ATUM’s own listeners — which fire on subsequent hooks — to find the data they need and process the inventory deduction correctly.
10, 3Hook priority 10; 3 tells WordPress the callback accepts three arguments — $order_id, $checkout_data, and $order.

How to Apply This Code

  1. Open Appearance → Theme File Editor or the Code Snippets plugin.
  2. Paste the snippet into your child theme’s functions.php or create a new dedicated snippet.
  3. Save and create a test order through Phone Orders for a product that has stock in multiple ATUM inventory locations.
  4. Open the completed order in the WooCommerce admin and check the ATUM Multi-Inventory panel to confirm inventory quantities deducted correctly from the right locations.

⚠️ Always use a child theme or Code Snippets — parent theme files get overwritten on theme updates.


When Should You Use This Fix?

This fix applies when your store uses ATUM Multi-Inventory to manage stock across multiple warehouse locations and agents create orders through Phone Orders PRO. Without it, Phone Orders orders don’t trigger ATUM’s inventory assignment — stock quantities don’t deduct from the correct locations, causing inventory inaccuracies between Phone Orders-created orders and storefront orders.

Have questions? Please submit a support request. We're always happy to help!

Phone Orders
for WooCommerce
PRO

From $120
Buy
✓ 30-day money-back guarantee