Advertisement
ikai2

Dawn Cart Update AIO

May 8th, 2023 (edited)
920
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.69 KB | Source Code | 0 0
  1. <!-- PAGEFLY CART HELPER - DO NOT DELETE -->
  2. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
  3.   <script>
  4.         try {
  5.         setTimeout(function () {
  6.           window.__pagefly_helper_store__ &&
  7.             window.__pagefly_helper_store__.subscribe(function (r) {
  8.  $.getJSON('/?sections=cart-notification-product,cart-notification-button,cart-drawer,cart-icon-bubble').then( sections => {
  9.                       const cartDrawer =document.querySelector('cart-notification') || document.querySelector('cart-drawer')
  10.                       cartDrawer.classList.remove('is-empty')
  11.                       r.sections = sections
  12.                       cartDrawer.renderContents(r)
  13.                      
  14.                     })
  15.  
  16. });
  17.         }, 2500);
  18.       } catch (e) {
  19.         console.warn(e);
  20.       }
  21.   </script>
  22. <!-- PAGEFLY CART HELPER - END -->
  23.  
  24.  
  25.  
  26. <!-- PAGEFLY CART HELPER - DO NOT DELETE -->
  27. <script>
  28. window.addEventListener("load", () => {
  29.   try {
  30.     window.__pagefly_helper_store__ &&
  31.       window.__pagefly_helper_store__.subscribe(function (r) {
  32.       async function fetchData() {
  33.         const response = await fetch(
  34.           "/?sections=cart-notification-product,cart-notification-button,cart-drawer,cart-icon-bubble"
  35.         );
  36.         const sections = await response.json();
  37.         const cartDrawer =
  38.           document.querySelector("cart-notification") ||
  39.           document.querySelector("cart-drawer");
  40.         cartDrawer.classList.remove("is-empty");
  41.         r.sections = sections;
  42.         cartDrawer.renderContents(r);
  43.       }
  44.       fetchData();
  45.       });
  46.   } catch (e) {
  47.     console.error("PF Error: ", e);
  48.   }
  49.   });
  50. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement