Comments 1moni started the conversationApril 4, 2026 at 9:36pmhow can I put the total saving on after text?total saving = saving per unit [a] X number of units 1,688Dustin repliedApril 7, 2026 at 4:23amHi Moni, Please add the custom code below. (How to add custom code? ↗): add_action( 'wp_footer', function () { ?> <script type="text/javascript"> (function($) { (function($) { $(document).on('wpcpq_init_table', function(e, $table, total, qty) { var ori_price = parseFloat($table.data('o_price')); var ori_total = ori_price * qty; if (ori_total > total) { if ($table.find('.wpcpq-saved').length) { $table.find('.wpcpq-saved').html('(Saved: ' + wpcpq_format_price(ori_total - total) + ')'); } else { var saved = '<span class="wpcpq-saved" style="color: green; margin-left: 10px; font-weight: 400">(Saved: ' + wpcpq_format_price(ori_total - total) + ')</span>'; $table.find('.wpcpq-summary-total').append(saved); } } else { $table.find('.wpcpq-saved').remove(); } }); })(jQuery); })(jQuery); </script> <?php }, 99 ); The result will be like this: Best regards,Dustin 1moni repliedApril 12, 2026 at 3:13amthanks Dustin1. it is not quite what I meant ... I was aiming to replace the (saved 10%) in your example to show the total saved ($ saving per unit X # of units)2. I added it and it does not work. probably did not define the place to add correctly - see atached picture?Attached files: add snippet.png 1,688Dustin repliedApril 16, 2026 at 2:54amYou should display "saved per unit" on the board to avoid confusing customers, as they may change the quantity to something different from what's shown there. Please configure the snippet like that: Best regards,Dustin 1moni repliedApril 22, 2026 at 6:51pmHi Dustin.It still does not show... 1moni repliedApril 22, 2026 at 7:10pmOK, Found it... the snippet was inactive ... :-)1 Like Sign in to reply ...
how can I put the total saving on after text?
total saving = saving per unit [a] X number of units
Hi Moni,
Please add the custom code below. (How to add custom code? ↗):
add_action( 'wp_footer', function () { ?> <script type="text/javascript"> (function($) { (function($) { $(document).on('wpcpq_init_table', function(e, $table, total, qty) { var ori_price = parseFloat($table.data('o_price')); var ori_total = ori_price * qty; if (ori_total > total) { if ($table.find('.wpcpq-saved').length) { $table.find('.wpcpq-saved').html('(Saved: ' + wpcpq_format_price(ori_total - total) + ')'); } else { var saved = '<span class="wpcpq-saved" style="color: green; margin-left: 10px; font-weight: 400">(Saved: ' + wpcpq_format_price(ori_total - total) + ')</span>'; $table.find('.wpcpq-summary-total').append(saved); } } else { $table.find('.wpcpq-saved').remove(); } }); })(jQuery); })(jQuery); </script> <?php }, 99 );The result will be like this:
Best regards,
Dustin
thanks Dustin
1. it is not quite what I meant ... I was aiming to replace the (saved 10%) in your example to show the total saved ($ saving per unit X # of units)
2. I added it and it does not work. probably did not define the place to add correctly - see atached picture?
Attached files: add snippet.png
You should display "saved per unit" on the board to avoid confusing customers, as they may change the quantity to something different from what's shown there.
Please configure the snippet like that:
Best regards,
Dustin
Hi Dustin.
It still does not show...
OK, Found it... the snippet was inactive ... :-)