Advertisement
NikolayBezay

Walla save productPrice for Adoric system GTM teg

Nov 26th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.57 KB | None | 0 0
  1. <script>
  2. (function() {
  3.     var checkPrice = setInterval(function() {
  4.         var productPrice = document.querySelector('.buyboxform .price');
  5.         if (productPrice) {
  6.             clearInterval(checkPrice);
  7.             var priceValue = productPrice.getAttribute('data-price');
  8.             priceValue = JSON.parse(priceValue);
  9.             if (priceValue.Price) {
  10.                 window.adoricCurrentProductPrice = priceValue.Price;
  11.             }
  12.         }
  13.     }, 500);
  14.    
  15.     setTimeout(function() {
  16.         clearInterval(checkPrice);
  17.     }, 7000);
  18. })();
  19. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement