Add Coupon Code to Website

Coupon code is added in the post-checkout page.The email id,order id,coupon code ,subtotal,discount total etc are called inside the Coupon code script.
Jira code:SQUIP-232

Requirement
To use the coupons in Bronto we need to put the below code on a post checkout page to track the coupons.
<script type=”text/javascript” src=”https://c.bron.to/assets/coupon/js/bcm.js“></script>
<script type=”text/javascript”>
__bcm.redeemCoupon(“2189ce376cf1aecfa5a45005aa45fa17b15442e371b8f30502709cc6c6d3c559”, {
email: <value-or-selector-definition>,
coupon: <value-or-selector-definition>,
orderId: <value-or-selector-definition>,
orderSubtotal: <value-or-selector-definition>,
orderDiscount: <value-or-selector-definition>
});
</script>

Our Solution
The redeem copoun code is added in the post-checkout page. The email id, order id, coupon code , subtotal, discount total etc are called inside the Coupon code script. All the values are taken from the model file (Models.js)to confirmation page js(OrderWizard.Module.Confirmation.js) and from there it is called inside the template(confirmation_module.txt).Since the email is not inside the model file it was fetched by adding a search field.

Leave a comment

Your email address will not be published. Required fields are marked *