less than a minute read • Updated 8 minutes ago
Set up multicurrency discounts and coupons
How to set different discount and coupon values per currency using JSON syntax for product discounts, category discounts, and coupon codes.
Product discounts, category discounts, and coupon codes can all set different values per currency using JSON syntax. Before setting these up, make sure you're familiar with how coupons and discounts work.
Syntax
Add a JSON object with a value per currency code. For a product discount:
&discount_quantity_amount=bogo 100{"discount_type": "repeat", "USD": "2-10", "MXN": "2-150"}The same JSON goes directly into the coupon or discount details field for category discounts and coupon codes.
In a form
html
<form action="https://yourdomain.foxycart.com/cart">
<input type="hidden" name="name" value="975mxn bogo 2">
<input type="hidden" name="price" value="975MXN">
<input type="hidden" name="code" value="abc130">
<!-- Use single quotes here, because form inputs don't handle URL encoding -->
<input type="hidden" name="discount_quantity_amount"
value='bogo 100{"discount_type": "repeat", "USD": "2-10", "MXN": "2-150"}'>
<input type="submit">
</form>Notes
The syntax must be valid JSON, so use double quotes around all values.
Because of the double quotes, either URL encode the whole string, or wrap it in single quotes instead. For form inputs, use single quotes (form inputs don't handle URL encoding).
If a currency isn't included in the JSON, the discount won't apply for that currency. This is intentional, to prevent discounts from applying with significantly wrong values after conversion.