Phone Orders For WooCommerce

WPC Product Bundles for WooCommerce

Phone Orders correctly handles WPC Product Bundles by skipping child items, marking them as child cart items, and keeping the bundle price read‑only. This article provides a complete code snippet that ensures bundled products behave correctly when an agent adds them to a manual order.


The Complete Code Snippet

Copy and paste the following code into your child theme’s functions.php file or via the Code Snippets plugin.

How the Code Works

FilterPurpose
wpo_skip_add_to_cart_itemReturns true for any item that has a woosb_parent_id key (i.e., a child product of a bundle). The plugin skips adding child items directly – only the parent bundle is added.
wpo_is_child_cart_itemMarks any item with woosb_parent_id as a child cart item. The plugin later groups child items under the parent bundle.
wpo_search_product_typesAdds the product type woosb to the product search, so agents can find bundle products in the phone order interface.
wpo_add_configured_products_skip_itemSkips adding child items when the plugin auto‑configures bundled products.
wpo_children_cart_itemReturns the array of woosb_keys (child item IDs) for a parent bundle item. The plugin uses this to group the child items under the parent.
wpo_cart_item_is_price_readonlyMakes the price read‑only for any cart item that has woosb_keys (i.e., the parent bundle).
wpo_load_order_skip_itemSkips loading child items when the plugin loads an existing order from the database.

The bundle item itself is the only item added directly; the plugin automatically pulls in the child products from the WPC configuration.


Why You Need This Code

Without these filters, adding a WPC Product Bundle to a phone order produces incorrect results. Child items may appear twice, the total price may be wrong, or the bundle may appear as a single product without its components. The code ensures the bundle displays correctly with its child items listed underneath it, and the price field remains read‑only to preserve the bundle’s calculated total.


Step‑by‑Step Implementation

  1. Copy the entire code snippet.
  2. Install and activate the free Code Snippets plugin.
  3. Go to Snippets → Add New.
  4. Give the snippet a title, for example “Phone Orders – WPC Product Bundles”.
  5. Paste the code into the Code text area.
  6. Set the “Run snippet” option to “Run everywhere”.
  7. Click Save Changes and Activate.

Testing the Integration

  1. Create a bundle product using the WPC Product Bundles plugin (at least two child products).
  2. Add the bundle to a phone order.
  3. Verify that the bundle appears in the cart with all child items listed underneath it.
  4. Complete the order.
  5. Check the order details in WooCommerce → Orders. The bundle should display correctly with its child items, and the total price should match the bundle’s configuration.

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