-
-
Save tieutantan/4f5244208af199fd12ede8926c18a185 to your computer and use it in GitHub Desktop.
Wait for an element to exist on the page with jQuery
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
// Convert shop the look pricing (EURO only) to cart currency | |
var existGetTheLook = setInterval(function () { | |
if ($('.stl__presentmentPrice').length) { | |
clearInterval(existGetTheLook); | |
let price_needed = 'data-currency-' + cart_currency.toLocaleLowerCase(); | |
$('span[class="stl__presentmentPrice"]').each(function (index, item) { | |
let price_by_currency = $(item).attr(price_needed); | |
$(item).children('.price').html(price_by_currency + ' ' + cart_currency); | |
}); | |
} | |
}, 100); // check every 100ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment