Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| v:2.0:snippets:updating_total_price_with_option_modifers [2023/07/12 10:33] – [Step 1: Include snippet] adam | v:2.0:snippets:updating_total_price_with_option_modifers [2023/07/12 10:38] (current) – [Dynamically triggering recalculation] adam | ||
|---|---|---|---|
| Line 41: | Line 41: | ||
| <code javascript> | <code javascript> | ||
| + | |||
| + | ==== Modify dynamically calculated total price ==== | ||
| + | |||
| + | If you need to dynamically modify the calculated price, for example if your product prices are tax exclusive, but you want to show the calculated price as tax inclusive, you can define a function on your page to achieve that result. The function has a name of '' | ||
| + | |||
| + | As an example, let's say you want to account for a 25% inclusive tax on your product prices, that would look like this: | ||
| + | |||
| + | <code javascript>< | ||
| + | function fc_adjust_price_display(price) { | ||
| + | return price * 1.25; | ||
| + | } | ||
| + | </ | ||
| ===== That's it! ===== | ===== That's it! ===== | ||