Last active
September 12, 2021 15:21
-
-
Save aatronco/c7a72d6e88ec84ee972e894fccf9a895 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment