Created
November 12, 2020 07:42
-
-
Save nstone101/34ad2ffb11db5677c318a290e722a91b 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
var products = ["TITLE1", "TITLE2", "TITLE3"]; | |
$( ".btn-coupon" ).click(function(e) { | |
$( ".cart-line-items-v2 li" ).each(function() { | |
var productTitle = $(this).find(".line-title").text(); | |
console.log("Product Title: " + productTitle); | |
for (i = 0; i < products.length; i++) { | |
if (productTitle == products[i]) { | |
e.preventDefault; | |
break; | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment