Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function () {
- function updateWhiteListCheckResult() {
- var whiteListProducts = ['291087', '287853', '292934', '291092', '292935', '292939', '291084', '291085', '292936', '287881', '287861', '290145', '290152', '287862', '287863', '287864', '290146', '289067', '287984', '287832', '287833', '287859', '290147', '288879', '287838', '288878', '289825', '287878', '289065', '289066', '287846', '287847', '287850', '287851', '291090', '287834', '287835', '287854', '288606', '288603', '289149', '289150', '287848', '287849', '287858', '287880', '287860', '287836', '287986', '289045', '287983', '287828', '289827', '287985', '287606', '287607', '288877', '288602', '285991', '287509', '287510', '284298', '285740', '281807', '281823', '281804', '274599', '274604'];
- var productsData = JSON.parse(window.localStorage.getItem('mage-cache-storage'));
- if (productsData && productsData.cart && productsData.cart.items) {
- productsData = productsData.cart.items;
- var isItemInWhiteList = false;
- productsData.forEach(function(item) {
- isItemInWhiteList = whiteListProducts.some(function(productData) {
- return productData === item.product_id;
- });
- if (isItemInWhiteList) {
- window.showAccessoriesSale = true;
- return null;
- }
- });
- }
- }
- updateWhiteListCheckResult();
- document.querySelector('BODY').addEventListener('click', updateWhiteListCheckResult);
- document.querySelector('BODY').addEventListener('touched', updateWhiteListCheckResult);
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement