Created
December 5, 2016 17:53
-
-
Save mmeo/07308187ac287d52d86cbc23f0a7c8cc to your computer and use it in GitHub Desktop.
This file contains 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
function ChangeCouponMessage() | |
{ | |
//define the coupon value entered by user | |
var coupon = $("#subscription_coupon_code").val(); | |
//if the coupon ends with some value (for example, "abc") then apply the specific coupon message. | |
//The end of the coupon is used so the full coupon name does not appear in the source code | |
if (coupon.match("abc$")) { | |
coupon_text = $('#long_coupon_message').find(".success_message"); | |
coupon_text2 = coupon_text.text("Coupon Message Example 1") | |
} | |
//else if, the coupon ends with "def", put another coupon message | |
else if (coupon.match("def$")) { | |
coupon_text = $('#long_coupon_message').find(".success_message"); | |
coupon_text2 = coupon_text.text("Coupon Message Example 2") | |
} | |
}; | |
$(document).bind("afterSummaryRefresh", ChangeCouponMessage); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment