Can shoppers choose different variants of your products, changing the price of the product? You will need to use this feature.
data-purchase-amount
).
You can do it with this little snippet of JavaScript:
Remember to replace the
newPurchaseAmount
with the actual value you want to set, in the same format as the one you set in the placement.data-purchase-amount
data attribute is updated.
If you are also using custom variables in your placements, you will need to update them and then trigger the refresh manually, using the refresh
function.
For example, let’s say you are using the category
variable in your placement, and you want to refresh the placement when the shopper changes the category:
id
of the specific placement you want to refresh, you can do it with a single line of JavaScript: