Fetch request to fix cart count

PHOTO EMBED

Mon Sep 18 2023 15:23:04 GMT+0000 (Coordinated Universal Time)

Saved by @DeelenSC

fetch('/cart.js')
  .then(response => response.json())
  .then(cart => {
    if (
      typeof window.BOLD !== 'undefined' &&
      typeof window.BOLD.common !== 'undefined' &&
      typeof window.BOLD.common.cartDoctor !== 'undefined'
    ) {
      cart = window.BOLD.common.cartDoctor.fix(cart);
    }
    // Rest of your code here
  })
  .catch(error => {
    console.log('Error fetching cart:', error);
  });
content_copyCOPY