NikolayBezay

Wineroute dynamic data for Adoric GTM teg

Nov 12th, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.58 KB | None | 0 0
  1. <script>
  2. (function() {
  3.     URL = 'https://www.wineroute.co.il/api/basket/list?sid=0';
  4.     var data = null;
  5.     var xhr = new XMLHttpRequest();
  6.     xhr.withCredentials = true;
  7.     xhr.addEventListener('readystatechange', function () {
  8.         if (this.readyState === 4) {
  9.             var cartData = JSON.parse(this.responseText);
  10.             var totalCartSum = parseInt(cartData.TotalSum);
  11.             window.adoricTotalCartSum = totalCartSum;
  12.         }
  13.     });
  14.     xhr.open('GET', URL);
  15.     xhr.setRequestHeader('cache-control', 'no-cache');
  16.     xhr.send(data);
  17. })();
  18. </script>
  19.  
Advertisement
Add Comment
Please, Sign In to add comment