Skip to main content

WooCommerce Discount Rules Shortcodes: Complete Guide & Reference

Unlock complete design freedom in your WooCommerce store by displaying dynamic pricing tables, live prices, countdown timers, purchase messages, and discounted product grids anywhere on your site using shortcodes.

Whether you are designing a custom single product page with Elementor, Gutenberg, Divi, Bricks, or building dedicated Black Friday landing pages, this guide provides the exact shortcodes, attributes, restrictions, and implementation best practices.


📋 Table of Contents


⚡ Quick Reference Matrix

Here is a quick overview of all shortcodes provided by the Discount Rules and Dynamic Pricing for WooCommerce plugin:

ShortcodePurposeAccepts product_id?Supported LocationsExample
[wccs_bulk_table]Display bulk tiered discount pricing tableYesProduct Page, Custom Landing Pages, Blog Posts[wccs_bulk_table product_id="123"]
[wccs_purchase_message]Display promotion / upsell purchase messagesYesProduct Page, Custom Landing Pages, Popups[wccs_purchase_message product_id="123"]
[wccs_live_price]Display dynamic real-time updated priceNoSingle Product Page only[wccs_live_price]
[wccs_countdown_timer]Display flash sale countdown timerNoSingle Product Page only[wccs_countdown_timer]
[wccs_sale_flash]Display custom promotional sale flash badgeNoSingle Product Page only[wccs_sale_flash]
[wccs_discounted_products]Display grid/list of active discounted productsNoAny Page, Post, or Landing Page[wccs_discounted_products]

🎯 Shortcode Attributes & Context Rules

Understanding where and how shortcodes execute is critical for flawless store setup:

1. Global / Explicit Shortcodes (Support product_id)

Shortcodes like [wccs_bulk_table] and [wccs_purchase_message] accept the optional product_id attribute.

  • On a Single Product Page: You can omit product_id. The shortcode automatically detects the current product ID from WordPress global query context.
  • On Custom Landing Pages / Blog Posts / Site Headers: You must provide product_id="ID" (e.g. [wccs_bulk_table product_id="45"]) so the plugin knows which product's rules to calculate and display.

2. Context-Sensitive Shortcodes (Product Page Only — No product_id)

Shortcodes such as [wccs_countdown_timer], [wccs_live_price], and [wccs_sale_flash] rely on the real-time runtime state of the active single product template (including live variation selection, dynamic price updates, and active JavaScript hooks).

  • Placement: Use these shortcodes strictly on single product pages or within custom product single builder templates (e.g., Elementor Single Product template, WooCommerce Block single product template).
  • Attribute: Do not pass product_id to these shortcodes as they do not support it and will not evaluate external product contexts.

1. [wccs_bulk_table] — Bulk Quantity Pricing Table

The [wccs_bulk_table] shortcode displays the tiered pricing breakdown table for products governed by Bulk Quantity Pricing Rules.

Quantity Table Example

Purpose & Benefits

  • Clearly shows shoppers the volume discounts available (e.g., Buy 2–4 for $18 each, Buy 5+ for $15 each).
  • Increases Average Order Value (AOV) by encouraging customers to buy in higher quantities.
  • Enables placing the table in custom sidebars, tabs, accordions, or modal popups rather than standard default positions.

Syntax & Usage

On Single Product Pages (Automatic Product Context)

[wccs_bulk_table]

On Any Page, Post, or Landing Page (Explicit Product ID)

[wccs_bulk_table product_id="105"]

(Replace 105 with your WooCommerce product ID).

Requirements

  • The target product must have an active Bulk Pricing Rule applied to it.
  • For detailed styling and position configuration, refer to the Quantity Table Documentation.

2. [wccs_purchase_message] — Dynamic Purchase & Promotion Message

The [wccs_purchase_message] shortcode displays dynamic promotion alerts, upsell hints, and personalized discount notices configured within your pricing rules.

Purchase message

Purpose & Benefits

  • Notifies customers of available incentives before adding to cart (e.g., "Add 2 more to get 20% off!" or "Buy 1, Get 1 50% Off during our weekend sale!").
  • Drives buyer engagement and guides customer purchasing behavior directly near the call-to-action.

Syntax & Usage

On Single Product Pages (Automatic Context)

[wccs_purchase_message]

On Custom Landing Pages or Promotional Banners

[wccs_purchase_message product_id="250"]

Requirements

  • An active pricing rule with a Purchase Message configured under the rule's Display / Messages settings.
  • The product must be eligible for the rule conditions.

3. [wccs_live_price] — Real-Time Live Price Display

The [wccs_live_price] shortcode renders the calculated dynamic price of a product in real time as the customer changes quantities or selects variable attributes.

Live Price Example

Live Price Example 2

Purpose & Benefits

  • Eliminates price confusion by immediately reflecting bulk tiered discounts or quantity breaks before the item is added to the cart.
  • Perfect for custom product layouts where standard WooCommerce price hooks have been rearranged or modified.

Syntax & Usage

[wccs_live_price]

⚠️ Important Limitation: [wccs_live_price] does not accept the product_id attribute. It must only be placed on Single Product Pages where the live variation and quantity scripts are active.


4. [wccs_countdown_timer] — Urgency Countdown Timer

The [wccs_countdown_timer] shortcode outputs a high-converting countdown clock indicating when a scheduled promotion ends.

Countdown Timer Example

Purpose & Benefits

  • Creates immediate FOMO (Fear Of Missing Out) and urgency.
  • Dramatically lowers cart abandonment for time-sensitive deals and flash campaigns.

Syntax & Usage

[wccs_countdown_timer]

⚠️ Important Limitation:

  • [wccs_countdown_timer] does not accept the product_id attribute. It is designed solely for Single Product Pages.
  • The countdown timer only renders if the product is linked to a scheduled pricing rule with an active end date/time. If no schedule is active or if the promotion has ended, the timer remains hidden automatically.

For a complete setup guide on scheduling rules, visit the Countdown Timer Documentation.


5. [wccs_sale_flash] — Sale Flash Badge

The [wccs_sale_flash] shortcode renders the promotional on-sale badge or custom percentage discount flash badge for the current product.

Purpose & Benefits

  • Allows full control over where the "SALE!" or "SAVE 30%" badge appears in custom theme builders.
  • Ideal when standard WooCommerce sale flash hooks (woocommerce_before_single_product_summary) are hidden or overridden by page builder templates.

Syntax & Usage

[wccs_sale_flash]

⚠️ Important Limitation: [wccs_sale_flash] does not accept the product_id attribute and must be used on single product pages or custom single product templates.

For customization of badge styles, colors, and percentage badges, see Sale Badge Guide and Percentage Badge Guide.


6. [wccs_discounted_products] — Showcase On-Sale & Discounted Items

The [wccs_discounted_products] shortcode dynamically pulls and displays a curated catalog or grid of products currently benefiting from active discount rules and on-sale pricing.

Purpose & Benefits

  • Automatically build "Deals of the Week", "Special Offers", or "Black Friday Sale" landing pages without manually updating product IDs every time rules change.
  • Connect seamlessly with cart and checkout promotional banners to boost customer exploration and average order value.

Syntax & Usage

Display All On-Sale Products & Pricing Rules (Default)

[wccs_discounted_products]

Display Only Products with Active Dynamic Pricing Rules

[wccs_discounted_products onsale_products="0"]

📌 Restrictions & Considerations

  • onsale_products Parameter: Setting onsale_products="0" filters out standard WooCommerce sale products to showcase only plugin pricing rules. Default is onsale_products="1".
  • Variation Attributes Limitation: Discounts that are applied solely through specific product variation attributes (rather than product-wide or rule-level product/category assignments) may have restrictions in automated catalog discovery queries.
  • For complete setup instructions and connecting this page to cart/checkout notices, see the Promote On-Sale Products Guide.

🛠 Page Builder & Theme Integration Guide

Our shortcodes integrate seamlessly across all popular WordPress page builders and custom code templates.

1. WordPress Block Editor (Gutenberg)

  1. Edit your product or landing page.
  2. Click the + (Add Block) button and search for Shortcode.
  3. Paste your desired shortcode (e.g., [wccs_bulk_table product_id="123"] or [wccs_discounted_products]).
  4. Save or Publish the page.

2. Elementor / Elementor Pro

  1. Open the page or Single Product Template in Elementor.
  2. In the widget panel, search for the Shortcode widget.
  3. Drag and drop the Shortcode widget to your preferred position (e.g., right above the Add to Cart button).
  4. Enter [wccs_bulk_table] or [wccs_purchase_message].
  5. Click Update.

3. Divi Builder

  1. Insert a new module and choose Code or Text.
  2. Paste the shortcode into the content area.
  3. Save the module layout.

4. Custom PHP Template & Child Themes

If you are developing custom theme templates or using WordPress action hooks, use the standard WordPress do_shortcode() function:

<?php
// Display bulk table for a specific product ID
echo do_shortcode('[wccs_bulk_table product_id="105"]');

// Display live price on single product template
if ( is_product() ) {
echo do_shortcode('[wccs_live_price]');
}
?>

❓ Troubleshooting & FAQs

Why is the shortcode showing as plain text on the page?

  • Ensure the Discount Rules and Dynamic Pricing for WooCommerce plugin is installed and activated.
  • Check that the shortcode is wrapped in proper square brackets [...] and there are no extra unescaped HTML characters around the brackets.

Why does [wccs_bulk_table] or [wccs_purchase_message] show nothing?

  1. Rule Check: Verify that the product has an active pricing rule applied. If no rule conditions match the product, the output will intentionally be empty.
  2. Product ID Check: If placed on a non-product page (such as a standard page or post), verify that you provided the valid product_id attribute (e.g., [wccs_bulk_table product_id="55"]).

Why isn't the countdown timer showing up?

  • [wccs_countdown_timer] only displays if the pricing rule has a Schedule Date/Time set with a valid future end date.
  • Verify that [wccs_countdown_timer] is placed on a single product page and does not contain product_id.

Can I use [wccs_live_price] or [wccs_countdown_timer] in a homepage product slider?

No. These shortcodes require single product page DOM scripts and hooks. For product listings, showcase products using [wccs_discounted_products] or link shoppers directly to single product pages where timers and live pricing tables execute seamlessly.


🚀 Next Steps

Maximize your promotional conversions by combining shortcodes with other dynamic pricing features: