Showing bulk discount prices on product pages helps customers understand how buying larger quantities can save them money. This WooCommerce customization of dynamic bulk pricing allows prices to update automatically as customers adjust quantities, ensuring accuracy both on the product page and in the cart.
Additionally, for stores looking to implement other discount strategies—such as Buy X Get X or cart-based discounts Flexi BOGO for WooCommerce can be used to easily create and track multiple types of promotions.
In this guide, we’ll show how to implement bulk pricing on your product pages to boost conversions and encourage larger orders.
Solution: Show Bulk Discount Prices on WooCommerce Product Pages
The following code snippet enables bulk pricing by displaying a pricing table on the product page, dynamically updating the price as quantities change, and applying the correct bulk price in the cart and mini-cart.
// 1️⃣ Display Bulk Pricing Table
add_action( 'woocommerce_after_add_to_cart_form', 'ts_custom_bulk_pricing_table' );
function ts_custom_bulk_pricing_table() {
global $product;
// Bulk pricing tiers
$prices = array(
1 => $product->get_price(),
2 => 60,
3 => 50,
4 => 45
);
echo '<table class="bulk-pricing-table" style="margin-top:20px;"><thead><tr><th>Quantity</th><th>Unit Price</th></tr></thead><tbody>';
foreach ( $prices as $quantity => $price ) {
echo '<tr data-qty="' . $quantity . '" data-price="' . $price . '">
<td>' . $quantity . '</td>
<td>' . wc_price( $price ) . '</td>
</tr>';
}
echo '</tbody></table>';
}
// 2️⃣ Dynamic Price Update on Product Page
add_action( 'wp_footer', 'ts_bulk_price_dynamic_js' );
function ts_bulk_price_dynamic_js() {
if ( is_product() ) { ?>
<script type="text/javascript">
jQuery(document).ready(function($){
var prices = {};
$('.bulk-pricing-table tbody tr').each(function(){
var qty = $(this).data('qty');
var price = $(this).data('price');
prices[qty] = price;
});
var sortedKeys = Object.keys(prices).sort(function(a,b){ return b-a; });
$('form.cart').on('change keyup', 'input.qty', function(){
var qty = parseInt($(this).val());
if (qty < 1) qty = 1;
var newPrice = prices[1];
for (var i = 0; i < sortedKeys.length; i++) {
if (qty >= sortedKeys[i]) {
newPrice = prices[sortedKeys[i]];
break;
}
}
$('.single-product .price').html('$' + newPrice);
}).trigger('change');
});
</script>
<?php }
}
// 3️⃣ Apply Bulk Price in Cart and Mini-Cart (works with AJAX)
add_action( 'woocommerce_before_calculate_totals', 'ts_apply_bulk_price_in_cart', 20, 1 );
function ts_apply_bulk_price_in_cart( $cart ) {
if ( is_admin() && ! defined('DOING_AJAX') ) return;
foreach ( $cart->get_cart() as $cart_item ) {
$product = $cart_item['data'];
$qty = $cart_item['quantity'];
$prices = array(
1 => $product->get_price(),
2 => 60,
3 => 50,
4 => 45
);
krsort($prices);
$new_price = $prices[1];
foreach ($prices as $min_qty => $price) {
if ($qty >= $min_qty) {
$new_price = $price;
break;
}
}
// Apply the bulk price
$cart_item['data']->set_price( $new_price );
}
}
// 4️⃣ Refresh Mini Cart Fragments
add_filter( 'woocommerce_add_to_cart_fragments', 'ts_refresh_mini_cart_bulk_price' );
function ts_refresh_mini_cart_bulk_price( $fragments ) {
if ( WC()->cart ) {
// Recalculate totals to ensure mini cart prices are correct
WC()->cart->calculate_totals();
ob_start();
woocommerce_mini_cart();
$fragments['div.widget_shopping_cart_content'] = ob_get_clean();
}
return $fragments;
}
Output
When customers visit the product page, a bulk pricing table appears below the Add to Cart button, showing different quantity tiers and their corresponding unit prices.

As you change the quantity in the product input field, the product price dynamically updates to reflect the appropriate bulk price.

When you add products to the cart, the correct bulk price is automatically applied in both the main cart and mini-cart.

For stores that want to allow prices to automatically adjust as customers change product quantities in the cart or on the product page, you can apply dynamic bulk pricing for WooCommerce products based on quantity. Such WooCommerce customization helps customers clearly see how their savings increase with quantity, encouraging higher purchase volumes and improving the buying experience.
