Phone Orders For WooCommerce

WooCommerce TM Extra Product Options

Phone Orders captures all add‑on data from ThemeHigh Extra Product Options and stores it correctly on the final order. This article provides a complete code snippet that preserves the extra options and ensures the prices remain accurate.


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

Filter / ActionPurpose
wpo_update_cart_cart_item_metaCopies the tmpost_data (the serialised extra options) from the product into the cart item meta. The plugin later uses this data to build the final order.
wpo_update_cart_loaded_productAdds the extra options to the loaded product object when the phone order interface displays the cart. It also calculates a read‑only price (the base product price plus the add‑on costs) and formats the add‑on summary using wc_get_formatted_cart_item_data().
wpo_get_item_by_productCopies the tmpost_data into the product item when the phone order interface loads an existing order.
wpo_cart_item_is_price_readonlyMakes the price field read‑only in the cart table for any item that has extra options. This prevents the agent from accidentally overriding a price that includes complex add‑on costs.
woocommerce_add_cart_item_dataCalls the ThemeHigh plugin’s internal tm_add_cart_item_data method to process the extra options and calculate the final price. The priority 70ensures this filter runs after other cart‑item data filters.
wpo_init_frontend_pageEnqueues the ThemeHigh CSS file on the phone order frontend page, ensuring the extra options display correctly.

Why You Need This Code

Without these filters, the add‑on selections disappear when the agent adds the product to the phone order. The final order contains only the base product, and the customer does not receive the customisation they requested. The order total also fails to include the add‑on costs.

The code works with both the older TM_EPO class and the newer THEMECOMPLETE_EPO_Cart class, ensuring compatibility across different versions of the ThemeHigh plugin.


Step‑by‑Step Implementation

  1. Copy the entire code snippet.
  2. Install and activate the free Code Snippets plugin (search for “Code Snippets” in Plugins → Add New).
  3. Go to Snippets → Add New.
  4. Give the snippet a title, for example “Phone Orders – ThemeHigh Extra Options”.
  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 product that has at least one ThemeHigh Extra Product Options field (e.g., a text field for engraving, a colour swatch, or a file upload).
  2. Add that product to a phone order and fill in the extra options.
  3. Complete the order.
  4. Go to WooCommerce → Orders and open the order details. The extra options should appear as part of the line item.
  5. The price should reflect the base product price plus the add‑on cost.

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