Phone Orders For WooCommerce

WooCommerce Bookings, by WooCommerce

WooCommerce Bookings adds a booking product type to WooCommerce that stores date, time, duration, resource, and person data as cart item meta. Phone Orders for WooCommerce doesn’t recognise the booking product type out of the box — it won’t appear in product search results, and if an agent loads an existing order containing a booking, the booking meta won’t survive the cart reload correctly.

This snippet registers the booking product type with Phone Orders and ensures all booking meta persists correctly through cart updates, with price and quantity fields locked to prevent agents from accidentally breaking a booking’s pricing.


Code Sample

Code Explained (for Developers)

HookPurpose
wpo_search_product_typesAdds 'booking' to the list of product types Phone Orders includes in its product search results. Without this, searching for a bookable product returns no results.
wpo_cart_item_is_price_readonlyLocks the price field for any cart item that carries booking data. Booking prices depend on date, duration, and resource — an agent editing the price manually would break the booking’s integrity.
wpo_cart_item_is_qty_readonlyLocks the quantity field for booking items for the same reason — booking quantities tie directly to the number of persons or resources, not a generic count.
wpo_update_cart_cart_item_metaFires when Phone Orders rebuilds a cart item on update. The snippet clears stale wc_bookings_field_* POST values first, then repopulates them from the stored booking data — date, time, duration, resource, persons, and timezone — so WooCommerce Bookings recalculates the booking correctly. It also deletes the old _booking_id post if one exists, since the booking recreates on cart rebuild.
wpo_update_cart_loaded_productSyncs the booking data and read-only price when an existing cart item reloads, and populates readonly_custom_meta_fields_html with the formatted booking details for display in the Phone Orders UI.
wpo_get_item_by_productPasses the booking data array into the Phone Orders item object when a product first resolves to a cart item, ensuring the booking context travels with the item through all subsequent processing.

How to Apply This Code

  1. Open Appearance → Theme File Editor or the Code Snippets plugin.
  2. Paste the full snippet into your child theme’s functions.php or create a new dedicated snippet.
  3. Save and open Phone Orders. Search for a bookable product and confirm it appears in results.
  4. Add it to the cart and verify the booking date/time fields display correctly and the price and quantity fields are locked.
  5. Load an existing order containing a booking and confirm all booking details carry over correctly.

⚠️ 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 whenever your store uses WooCommerce Bookings and agents need to create or edit orders containing bookable products through Phone Orders PRO. Without it, bookable products don’t appear in Phone Orders search, and booking meta gets lost when the cart updates.

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