Alejandro Troncoso
2021-04-28T15:16:15Z

get_coupon_from_URL_parameter.js

| var callbackFunction = function() {
| console.log("Coupon " + discount + " added")
| }
|
| var add_url_coupon = function() {
| queryString = window.location.search;
| urlParams = new URLSearchParams(queryString);
| if (urlParams.has('discount')) {
| discount = urlParams.get('discount')
| Jumpseller.addCouponToCart(discount, {
| callback: callbackFunction
| })
| }
| }
|
| $(document).ready(add_url_coupon);