Bulk edit wholesale prices in WooCommerce: B2BKing, Wholesale Suite
To bulk edit wholesale prices in WooCommerce, you edit the fields where your B2B plugin keeps them. WooCommerce itself has one regular and one sale price per product. B2BKing, Wholesale Suite, B2B Market, Role Based Price for WooCommerce and the role prices of the FOX currency switcher add their own prices and save them as product meta. BEAR edits that meta as ordinary columns: you can set a wholesale price for hundreds of products, raise it by a percentage, or calculate it from the regular price. What decides how far you can go is the way the plugin stores the price: one number per key, or an array that holds the prices of several roles at once.
Where B2B and wholesale plugins store their prices
| Plugin | How the price is stored | How to edit it in BEAR |
|---|---|---|
| B2BKing (group prices) | One key per customer group and price type, for example b2bking_regular_product_price_group_717 and b2bking_sale_product_price_group_717, where 717 is the ID of the group | Number meta field: set, percentages, formulas |
| Wholesale Suite | One key per wholesale role, for the default role wholesale_customer_wholesale_price | Number meta field: set, percentages, formulas |
| Role Based Price for WooCommerce | The prices of all roles together in one serialized array | Array view: edit and copy, no percentages |
| B2B Market | Group prices in arrays | Array view: edit and copy, no percentages |
| FOX, Individual prices based on user role | Three arrays: _woocs_price_user_role_name, _woocs_regular_price_user_role, _woocs_sale_price_user_role | Array view: edit and copy, no percentages |
Treat the table as a map, not as the final word: the group or role part of a key is different on every site, and plugins change their storage between versions. Confirm the keys on your own shop. Fill in the wholesale price of one product by hand, then in BEAR's Meta Fields tab enter that product's ID in Get meta keys from any product by its ID and press Get. The list shows every custom key of the product; the ones that hold your numbers are the ones you need. For prices set per variation, enter the ID of a variation instead: variation prices are meta of the variation, not of the parent product.
Add the wholesale prices as columns
- In the Meta Fields tab keep the wholesale keys from the list, or type a key into Add Custom key by hands.
- Give each one a short title such as Wholesale or Group 717 sale. For a single number choose the view textinput and the type number; for an array choose the view array.
- Press Save meta fields, then switch the new columns on in the Settings tab and save. A meta field appears in the Filters and Bulk Edit tabs only while its column is on.
The Meta Fields documentation describes both ways of adding keys. With the type set to number, a wholesale column behaves like a price: it sorts, filters by a from/to range and has the price calculator in its cells.
Bulk edit wholesale prices like the regular price
Filter the products, check the line Bulk editing will be applied to at the top of the Bulk Edit tab, and use the wholesale row in the numeric section: set new, increase by %, decrease by %, increase by value or decrease by value. For variable products, switch on variations on the tools panel first: the run then writes to the variations and leaves the parents alone, which is where per-variation wholesale prices live.
The built-in price rows have extra operations such as regular price minus % for the sale price. Meta fields do not, because BEAR cannot know which field a custom price belongs to. You connect them yourself with the block under the numeric rows called Selected num fields: an operator (+, -, *, /) and a list of the numeric columns. After the row's own operation, BEAR applies that operator with the chosen field of the same product.
Wholesale price = regular price minus a percentage
For a wholesale price 25% below the regular price:
- Filter the products, and add regular price from
0.01so that products without a price are left out. Otherwise they get a wholesale price of 0. - Tick only the wholesale row, choose set new and enter
0.75. - In Selected num fields choose
*and regular price. - Pick a rounding in the drop-down under the numeric rows if you want endings such as .99, and press Do Bulk Edit. A product at 40.00 gets a wholesale price of 30.00.
The factor is 1 - discount: 0.8 for 20% off, 0.65 for 35% off. The formula goes into every numeric row that is ticked, so tick nothing else in the same run. For variable products run it with variations on, because the parents have no regular price of their own.
Wholesale sale price from the wholesale regular price
Plugins with a separate wholesale sale price, such as B2BKing, take the same approach with the wholesale field as the source. Tick the group's sale row, set new 0.9, and choose * with the group's regular price column: every product gets a wholesale sale price 10% below its wholesale price. To copy one field into another unchanged, use set new 0 with + and the source field. More formulas between fields, including two-step calculations, are in setting prices from a custom field.
Prices stored as arrays: Role Based Price, B2B Market, FOX role prices
When one key holds the prices of several roles, BEAR shows it as an Array button. A click opens a popup with the keys and values of that product, where you can change any price and save. If an array field shows its data wrongly or has no Array button, its view is not set to array in the Meta Fields tab.
For many products at once, prepare one product as the example and click its Array button. Then tick the field in the Bulk Edit tab, open its button to check the data, press Apply in the popup and run Do Bulk Edit. Every selected product receives the same array, which suits shops where a role pays the same price for a whole group of products. The steps are in bulk edit of serialized meta data.
What arrays do not allow is arithmetic. Increase by % works only on number fields, so a 5% rise of all role prices stored in an array has to be done product by product in the popup, or by the pricing plugin's own tools if it has a global percentage rule.
FOX's role prices are a special case. _woocs_price_user_role_name holds the rules (which roles each rule applies to), and _woocs_regular_price_user_role and _woocs_sale_price_user_role hold the prices of the same rules under the same rule keys. The prices are in the shop's base currency and FOX converts them for the visitor's currency, so they are not per-currency prices. When you copy role prices from an example product, copy all three fields from that same product, so that the rule keys keep matching.
The editor shows the wholesale price in the regular price column
If the Regular price column shows a different number than the General tab of the product's edit page, a pricing or currency plugin is changing prices for your own account. BEAR reads prices through WooCommerce's product functions, and B2B plugins apply their prices in exactly those functions. When the administrator who opens BEAR belongs to a B2B group or has a wholesale role, the plugin hands BEAR the wholesale price, and the regular price column shows it. With an account that has no B2B role, the same products show their real regular prices.
This is more than a display problem. Increase by % and decrease by % on the regular price start from the number BEAR reads, so a 10% rise would save the wholesale price plus 10% as the new regular price. Before you run price operations:
- Work in BEAR with an administrator account that is not in any B2B group or wholesale role.
- Compare two or three products in the Regular price column with their edit pages.
- If a plugin changes prices in wp-admin for every user, use the snippet in bulk editing prices per currency, which stops price filters during BEAR's own requests. It was written for currency switchers and works the same way for B2B pricing plugins.
Meta fields are not affected: BEAR reads them as stored, not through the price functions, so the wholesale columns always show the saved values.
Check that wholesale customers see the new prices
- Log in as a test customer of the group or role in a second browser, after clearing the page cache, and open a few edited products.
- If the value is right in BEAR but the customer still sees the old price, compare the meta keys of that product with one you saved by hand in the product editor (Get meta keys from any product by its ID for both). Some pricing plugins keep a helper key next to the price; if it is missing on the edited product, attach it as a column and set it on the edited products as well.
- A run that went wrong can be reverted in the History tab. Revert it rather than running the opposite percentage, because the second percentage is calculated from the new prices.
If your wholesale plugin stores prices in a way that none of the above covers, post the plugin name and a product ID on the BEAR support forum.