All things Shopify and commerce
So, I'm in Dawn version 11.0
In the Cart page, below the Total Price, I have a few items that users can see and click "Add to Cart".
If you do that, the cart pop up will appear as usual, asking if you want to "View Cart" or "Checkout".
The thing is, if you close the pop up (because you are already in the cart page), the Total Price won't update at all. Users will be misguided, they have more items in the cart and think the price is updated, but it's not.
This seems like a bug, can someone check?
Solved! Go to the solution
This is an accepted solution.
Hi @herastore
BTW, I added the solution in the github request here.
if (document.querySelector('#main-cart-footer')) {
fetch(`${routes.cart_url}`)
.then((response) => response.text())
.then((responseText) => {
const html = new DOMParser().parseFromString(responseText, 'text/html');
const sourceFooter = html.querySelector('#main-cart-footer');
document.querySelector('#main-cart-footer').innerHTML = sourceFooter.innerHTML;
})
.catch((e) => {
console.error(e);
});
}
Make sure to SAVE
Hi @herastore
You are right! It is a bug. It seems like the Dawn developers forgot to update the totalPrice as well. It needs to connect to the updateCart function. I submitted the new issue for you in github.
This is an accepted solution.
Hi @herastore
BTW, I added the solution in the github request here.
if (document.querySelector('#main-cart-footer')) {
fetch(`${routes.cart_url}`)
.then((response) => response.text())
.then((responseText) => {
const html = new DOMParser().parseFromString(responseText, 'text/html');
const sourceFooter = html.querySelector('#main-cart-footer');
document.querySelector('#main-cart-footer').innerHTML = sourceFooter.innerHTML;
})
.catch((e) => {
console.error(e);
});
}
Make sure to SAVE
Nice! Thanks a lot!
User | RANK |
---|---|
41 | |
39 | |
24 | |
24 | |
21 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023