Show bulk table below product title in category/shop page
By default, Advanced Dynamic Pricing for WooCommerce displays the bulk pricing table only on the individual product page. However, for stores that rely heavily on volume pricing, it can be highly effective to show the bulk discount table directly on category and shop pages — right below each product title — so shoppers can see pricing tiers without having to click through to a product.
This article provides a compact, ready-to-use snippet that injects the bulk pricing table into the product loop on any WooCommerce archive page (shop, category, tag, etc.), with a small built-in style override to keep the table compact and readable in a grid layout.
Code Sample
Add the following snippet to your theme’s functions.php or the Code Snippets plugin:
|
1 2 3 4 |
add_action( "woocommerce_after_shop_loop_item_title", function () { echo "<style>.wdp_pricing_table td {font-size: small;}</style>"; echo do_shortcode( "[adp_product_bulk_rules_table]" ); } ); |
Code Explained (for Developers)
| Element | Description |
|---|---|
add_action( 'woocommerce_after_shop_loop_item_title', ... ) | Hooks into the WooCommerce product loop, firing immediately after the product title is rendered on shop/category/archive pages. The bulk table will appear directly below the title for every product in the loop. |
echo '<style>.wdp_pricing_table td { font-size: small; }</style>' | Injects a small inline CSS override that reduces the font size of all cells in the bulk pricing table to small. This is important because the bulk table is designed for the full-width product page — on a shop grid it would otherwise appear oversized. See the Styling the Table section below for cleaner approaches. |
do_shortcode( '[adp_product_bulk_rules_table]' ) | Executes the Advanced Dynamic Pricing shortcode that renders the bulk discount rules table for the current product in the loop. Returns the table HTML as a string, which is immediately echoed to the page. |
Key concept: The
[adp_product_bulk_rules_table]shortcode is context-aware — when called inside the WooCommerce product loop (as it is here), it automatically renders the bulk table for the current loop product. No product ID needs to be passed manually.
Styling the Table
The inline <style> tag in the snippet is the quickest way to reduce the table’s font size, but it has a drawback: it is echoed once per product in the loop, resulting in duplicate style blocks in your page HTML. While this causes no visual issues, it is not clean markup.
For a production environment, we recommend one of the following alternatives:
Option 1 — Move the style to your theme’s stylesheet
Remove the echo '<style>...</style>'; line from the snippet entirely and add the rule to your child theme’s style.css instead:
|
1 2 3 |
.wdp_pricing_table td { font-size: small; } |
Option 2 — Enqueue the style properly using wp_head
|
1 2 3 4 5 6 7 8 9 |
add_action( 'wp_head', function() { if ( is_shop() || is_product_category() || is_product_tag() ) { echo '<style>.wdp_pricing_table td { font-size: small; }</style>'; } } ); add_action( 'woocommerce_after_shop_loop_item_title', function() { echo do_shortcode( '[adp_product_bulk_rules_table]' ); } ); |
This outputs the style block only once in the <head> and only on relevant archive pages, keeping the markup clean.
Additional CSS you may find useful:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
/* Reduce padding in bulk table cells for compact display */ .wdp_pricing_table td, .wdp_pricing_table th { padding: 4px 6px; font-size: small; } /* Hide the table on mobile to avoid layout issues */ @media ( max-width: 768px ) { .wdp_pricing_table { display: none; } } |
Controlling Which Pages Show the Table
The basic snippet fires on all WooCommerce loop pages. If you want to restrict it to specific page types, wrap the shortcode call in a conditional:
|
1 2 3 4 5 6 7 |
add_action( 'woocommerce_after_shop_loop_item_title', function() { // Show only on category pages, not the main shop page if ( ! is_product_category() ) { return; } echo do_shortcode( '[adp_product_bulk_rules_table]' ); } ); |
Useful WooCommerce conditionals:
| Conditional | Description |
|---|---|
is_shop() | Main WooCommerce shop page only |
is_product_category() | Any product category archive page |
is_product_tag() | Any product tag archive page |
is_woocommerce() | Any WooCommerce page (shop, category, tag, product) |
Hook Position Reference
The woocommerce_after_shop_loop_item_title hook sits inside the product loop in this order:
|
1 2 3 4 |
woocommerce_before_shop_loop_item_title → product image woocommerce_shop_loop_item_title → product title ← title rendered here woocommerce_after_shop_loop_item_title → rating, price ← bulk table injected here woocommerce_after_shop_loop_item → add to cart button |
If you prefer the bulk table to appear below the price rather than below the title, use woocommerce_after_shop_loop_item instead:
|
1 2 3 |
add_action( 'woocommerce_after_shop_loop_item', function() { echo do_shortcode( '[adp_product_bulk_rules_table]' ); } ); |
Performance Consideration
This snippet calls do_shortcode() for every product rendered in the loop. On a shop page with many products, this adds a price calculation per product. If you notice performance degradation on large catalogs, consider:
- Enabling object caching (e.g. Redis or Memcached) on your server.
- Limiting the display to specific categories using the conditionals above.
- Using the Category Page settings in Advanced Dynamic Pricing (Settings → Category Page) which has native built-in options for bulk table display on archive pages without requiring custom code.
⚠️ Always check the built-in Category Page settings at Advanced Dynamic Pricing → Settings → Category Page before using this snippet — the plugin may already support this natively in your version without any custom code required.
How to Apply This Code
- Open Appearance → Theme File Editor in your WordPress admin, or open the Code Snippets plugin.
- Paste the snippet (or your chosen variation from the sections above) into your active child theme’s
functions.php, or create a dedicated snippet. - Save and navigate to your shop or a category page.
- Confirm that the bulk pricing table appears below the product title for products that have active bulk discount rules.
⚠️ Editing
functions.phpdirectly can be overwritten during theme updates. A child theme or the Code Snippets plugin is the safer long-term approach.
When Should You Use This?
The built-in Category Page settings in Advanced Dynamic Pricing do not offer the exact positioning or styling flexibility you need.
You want shoppers to see volume pricing tiers on shop/category pages without requiring them to visit each product page individually.
Your store is B2B or wholesale-focused and quantity-based pricing is a primary purchasing driver.
You want to increase average order value by making bulk discount thresholds visible earlier in the shopping journey.