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);
  });