Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function () {
- var productLists = [
- {
- 'listName': 'listName_1',
- 'values': '271866, 271119, 273312, 271118, 269398, 268802, 268801'
- },
- {
- 'listName': 'listName_2',
- 'values': '273440, 270733, 269447, 210689, 271119'
- }
- ];
- var pageProductFormTimer = 10;
- function seveProductSku(productSku) {
- if (!productSku) return false;
- if (productSku.length == 0) return false;
- for(var i = 0; i < productLists.length; i++) {
- if (productLists[i].values.indexOf(productSku) != -1) {
- window[productLists[i].listName] = true;
- }
- }
- }
- function waitPageProduct() {
- pageProductFormTimer--;
- var productSkuElement = document.querySelector('[data-product-sku]');
- if (!productSkuElement && pageProductFormTimer > 0) {
- setTimeout(waitPageProduct, 1000);
- } else if (pageProductFormTimer > 0) {
- seveProductSku(productSkuElement.getAttribute('data-product-sku'));
- }
- }
- waitPageProduct();
- })();
- </script>
Add Comment
Please, Sign In to add comment