Pricepep's storefront output for four promotion tools comes from PHP templates that you can copy into your theme and edit: the Volume Pricing Table, the Countdown Timer, Product Banners and You Saved. Pricepep looks for a copy in yourtheme/wc-dynamic-pricing-and-discounts/extensions/<tool folder>/ before using its own template.
How do I override a template?
- Find the template in the plugin folder, under
extensions/<tool folder>/templates/(table below). - Create the same folder in your child theme:
wp-content/themes/<child theme>/wc-dynamic-pricing-and-discounts/extensions/<tool folder>/. - Copy the template there, keeping its file name, and edit the copy.
- Clear any page cache and check the product, cart or checkout page.
WordPress locate_template() is used, so a child theme copy wins over a parent theme copy, and both win over the plugin's file. Use a child theme: copies in a parent theme are lost when the theme updates.
Which templates can I override?
| Tool | Plugin template | Copy to (in your theme) |
|---|---|---|
| Volume Pricing Table | extensions/promotion-volume-pricing-table/templates/horizontal.php | wc-dynamic-pricing-and-discounts/extensions/promotion-volume-pricing-table/horizontal.php |
| Volume Pricing Table | .../templates/vertical.php | .../promotion-volume-pricing-table/vertical.php |
| Volume Pricing Table | .../templates/inline-horizontal.php, inline-vertical.php | .../promotion-volume-pricing-table/inline-horizontal.php, inline-vertical.php |
| Volume Pricing Table | .../templates/modal-horizontal.php, modal-vertical.php | .../promotion-volume-pricing-table/modal-horizontal.php, modal-vertical.php |
| Countdown Timer | extensions/promotion-countdown-timer/templates/countdown-timer.php | wc-dynamic-pricing-and-discounts/extensions/promotion-countdown-timer/countdown-timer.php |
| Product Banners | extensions/promotion-product-banners/templates/banner.php | wc-dynamic-pricing-and-discounts/extensions/promotion-product-banners/banner.php |
| You Saved | extensions/promotion-total-saved/templates/tr.php | wc-dynamic-pricing-and-discounts/extensions/promotion-total-saved/tr.php |
| You Saved | extensions/promotion-total-saved/templates/div.php | wc-dynamic-pricing-and-discounts/extensions/promotion-total-saved/div.php |
The admin screens (views/ in the plugin) can't be overridden, and Your Price, Customer Notifications and Cart Item Descriptions have no templates: change them with filters (see the filter reference).
Which variables do the templates get?
Volume Pricing Table
$title: the table title.$data: one entry per product or variation:'product'(WC_Product) and'table_data'(rows, orfalse). Each row has'range_label'(for example "10-19"),'range_price'(the value HTML),'price_raw'and'from'.
horizontal.php and vertical.php draw the table; the inline and modal templates wrap it (the modal one prints the title as a link and the table in a popup). Keep the data-rp-wcdpd-from and data-rp-wcdpd-variation-attributes attributes so clicks still set the quantity and variation. More in customizing the volume pricing table.
Countdown Timer
$product_id, $quantity, $label, $seconds_remaining, and $days, $hours, $minutes, $seconds (two digits each). The timer's script updates the numbers every second, so keep the original element classes in your copy. The template is also used for timers printed with rp_wcdpd_display_countdown_timer(). Actions inside the template: rp_wcdpd_promotion_countdown_timer_before_timer, ..._before_label, ..._after_label, ..._after_time, ..._after_timer.
Product Banners
$title and $message, with the macros ({{price}}, {{original_price}}, {{description}}, and since 2.6.0 {{start_date}} and {{end_date}}) already replaced. The template runs once per banner. Actions: rp_wcdpd_promotion_product_banners_before_banner_title, ..._after_banner_title, ..._before_banner_content, ..._after_banner_content.
You Saved
$label, $formatted_amount (price HTML), $amount (number), $column_count and $hook (the position). tr.php (a table row with the label and the amount) is used for positions inside a totals table, div.php for the other positions. In the Cart and Checkout blocks the row is drawn by a script instead, so these templates don't apply there; use the rp_wcdpd_promotion_total_saved_label and rp_wcdpd_promotion_total_saved_formatted_amount filters.
Example: add an icon to product banners
Copy banner.php to wc-dynamic-pricing-and-discounts/extensions/promotion-product-banners/banner.php in your child theme and add the icon before the title in your copy. Or, without a template copy, use an action:
add_action('rp_wcdpd_promotion_product_banners_before_banner_title', function () {
echo '<span class="my-banner-icon" aria-hidden="true">★</span> ';
});
What should I check after a Pricepep update?
Compare your copies with the plugin's templates when you update: if an original changed (for example new markup that the scripts rely on), copy it again and redo your changes. Filters and actions are often the lighter choice: see the filter reference and action reference.
Frequently asked questions
Where do Pricepep template overrides go?
In your theme: yourtheme/wc-dynamic-pricing-and-discounts/extensions//.php. A child theme is checked first, then the parent theme.
Will my template changes survive Pricepep updates?
Yes, copies in your theme are not touched by updates. Compare them with the plugin's templates after updates in case the originals changed.
Can I override the admin screens?
No. Only the storefront templates of the promotion tools can be overridden.