Customer Specific Pricing, by WISDM
The Customer Specific Pricing (CSP) for WooCommerce plugin by WisdmLabs is a powerful tool that allows store owners to set custom prices for individual customers, user roles, or groups. It is widely used in B2B, wholesale, and membership‑based stores where different customers see different prices for the same product. The plugin supports both flat‑rate customer‑specific pricing and percentage‑based discounts, making it highly flexible for various business models.
When an agent creates a manual order using the Phone Orders for WooCommerce plugin, the expectation is that the pricing rules defined by CSP should be applied automatically – the same way they are applied during a normal frontend checkout. However, a known compatibility issue can prevent this from happening. The phone order interface is considered part of the WordPress admin area (where is_admin() returns true). The CSP plugin, in its standard configuration, contains a condition that blocks price changes in the admin area, preventing customer‑specific prices from being applied to phone orders.
This guide explains why the conflict occurs, examines the specific code inside the CSP plugin that causes it, and provides a step‑by‑step solution. Since the CSP plugin does not offer a built‑in hook or filter to change this behaviour, the solution involves a minor modification to one of its core files. While not ideal, this change is straightforward and has been used successfully by many store owners.
Important Disclaimer: The following solution requires editing a plugin file. This change will be overwritten whenever you update the Customer Specific Pricing plugin. You must reapply the modification after each update. Using a child plugin or a custom code snippet (see the FAQ section for a more robust approach) is strongly recommended.
Understanding the Conflict: Why Customer‑Specific Prices Are Not Applied in Phone Orders
The WooCommerce Phone Orders plugin allows store agents to simulate the customer experience from the admin dashboard. When an agent selects a customer, the phone order interface should reflect that customer’s prices – including any custom pricing rules set by the CSP plugin.
However, the CSP plugin contains a conditional check that prevents it from applying custom prices in the WordPress admin area (is_admin()). This check was likely added to avoid conflicts with other admin‑side processes, such as editing products directly, where applying customer‑specific pricing would be undesirable.
Because the Phone Orders interface operates within the admin area (the URL contains /wp-admin/), the CSP plugin’s is_admin() check returns true, and the price‑modifying logic is skipped entirely. As a result, the agent sees the standard product price instead of the customer‑specific price that should apply.
The relevant code inside the CSP plugin is located in the following file:
wp-content/plugins/customer-specific-pricing-for-woocommerce/includes/class-wdm-apply-usp-product-price.php
Specifically, the condition on line 679 (the exact line number may vary slightly depending on the version of the CSP plugin installed) contains a check similar to this:
if ( ! is_admin() ) {
// Apply customer‑specific pricing logic
}
When the plugin is running in the admin area, is_admin() returns true, so ! is_admin() returns false, and the pricing logic is bypassed entirely. This prevents customer‑specific prices from being applied to phone orders.
The Solution: Modifying the CSP Plugin File
Since the CSP plugin does not provide a dedicated hook or filter to override this behaviour, the solution is to remove or comment out the is_admin() condition. This allows the pricing logic to run in the admin area as well.
Follow these steps carefully to implement the fix.
Step 1: Locate the Correct File
Using an FTP client (such as FileZilla) or your hosting control panel’s file manager, navigate to the following directory:
|
1 |
/wp-content/plugins/customer-specific-pricing-for-woocommerce/includes/ |
Inside this directory, locate the file:
|
1 |
class-wdm-apply-usp-product-price.php |
Step 2: Edit the File
Open the file in a plain text editor (do not use word processors like Microsoft Word, as they may introduce hidden characters).
Step 3: Find the is_admin() Condition
Search for the exact line number 679 (or search for the string ! is_admin()). The line may look like this:
|
1 |
if ( ! is_admin() ) { |
The condition may be part of a larger code block. The CSP documentation indicates that this is the line that prevents price changes in the admin area:
Step 4: Comment Out or Modify the Condition
There are two ways to proceed:
Comment Out the Entire Condition
|
1 |
// if ( ! is_admin() ) { |
Make sure to also comment out the corresponding closing brace } later in the file. This approach is straightforward and easy to reverse if needed.
Step 5: Save the File
Save the changes and upload the modified file back to the server (if you edited it locally) or click Save (if you are using the hosting control panel’s file editor).
Step 6: Test the Integration
- Log in to your WordPress admin area.
- Go to WooCommerce → Phone Orders.
- Select a customer who has a customer‑specific price configured for one or more products.
- Add a product that has a custom price for that customer.
- Verify that the product appears in the cart with the correct customer‑specific price, not the standard catalogue price.
If the price matches the customer’s custom pricing rule, the fix is working correctly.