I am building a B2B WordPress site using WooCommerce and the Wholesale Suite plugin. My company sells oil in bulk packaging:
Drum: 420 lbs. Tote: 2,100 lbs. I want to set a price per pound (e.g., $2.00/lb) and have WooCommerce automatically calculate the total price for each product based on its weight. Additionally, I need the ability to adjust the price per pound, and have it automatically update for all products.
Example:
Drum price = 420 * $2.00 Tote price = 2,100 * $2.00 Question: How can I configure WooCommerce (or Wholesale Suite) to apply a per-pound price dynamically to these bulk products? Do I need to use custom fields, formulas, or custom coding to achieve this?
I tried using the Weight Based Pricing for WooCommerce plugin, which allows dynamic pricing based on weight. However, I’m having difficulty ensuring that these dynamic prices reflect correctly in Wholesale Suite fields (e.g., customer-specific prices visible in their accounts).
You can use a combination of custom fields and custom PHP code to interface with the Wholesale Suite plugin and dynamically price bulk products in WooCommerce based on weight. Make sure the weight of each product is appropriately stated in WooCommerce and use Advanced Custom Fields (ACF) to create a custom field (e.g., price per lb) to set the price per pound. To dynamically determine the product price, multiply the weight by the price per pound using a custom PHP function in the function ph section of your theme. This guarantees that both retail and wholesale pricing reflect the determined price. For easier updates, implement a global price-per-pound option that applies to all products, ensuring seamless updates across the store while maintaining compatibility with Wholesale Suite's pricing logic.