Phone Orders For WooCommerce

Wholesale Suite – WooCommerce Wholesale Prices & B2B Plugin, by Rymera Web Co

Wholesale Suite by Rymera Web Co stores role-specific wholesale prices as product meta fields using the pattern {role_slug}_wholesale_price. When a sales agent creates a backend order in Phone Orders for WooCommerce, the session runs as the logged-in admin rather than the selected customer, so Wholesale Suite’s pricing never fires for the customer’s wholesale role — the agent sees and records the retail price instead.

This snippet hooks into the Phone Orders cart item preparation cycle and reads the wholesale price directly from product meta for the selected customer’s role, applying it with a correct discount breakdown.

Code Sample

Code Explained (for Developers)

ElementDescription
wpo_prepare_itemA Phone Orders filter that fires during cart item preparation. Sets price and discount data the plugin uses for display and order writing.
@$item['cost_updated_manually']Checks whether the agent already edited this item’s price manually in the UI. If so, the snippet exits and preserves the manual value.
$_REQUEST["cart"]["customer"]["id"]Reads the selected customer’s user ID from the Phone Orders AJAX request. Returns empty when no customer is selected yet — the snippet exits cleanly in that case.
reset( $user->roles )Retrieves the customer’s primary WordPress role slug. Wholesale Suite stores prices per role using this slug as part of the meta key.
{role}_wholesale_price metaThe product meta key Wholesale Suite uses for role-specific prices. The snippet reads this directly via get_post_meta() using the customer’s role slug.
{role}_wholesale_minimum_order_quantity metaThe minimum quantity threshold for the wholesale price to apply. If the cart item quantity falls below this value, the snippet returns the item at regular price.
wpo_item_discount arrayPhone Orders’ internal structure for discount breakdown. Filling discount_type, discount, original_price, and discounted_price ensures the UI and the saved order both reflect the correct wholesale price and discount amount.

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 open Phone Orders with a customer whose role has a wholesale price configured in Wholesale Suite.
  4. Add a product with a wholesale price for that role and verify the cart shows the correct wholesale price and discount breakdown.
  5. Test the minimum quantity threshold by adding fewer items than the minimum and confirming the retail price applies.

⚠️ 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 Wholesale Suite for role-based pricing and agents create backend orders through Phone Orders PRO. Without it, agents see retail prices for wholesale customers and the resulting orders carry incorrect prices.

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