Hello everybody. Hope you doing good. Currently, I have a major issue with the Fashe Theme on Shopify. The “remove” button on the cart page is not working properly. Every time I click the remove button, the checkout page suddenly appears. This happens as well when I click the “update cart” button. Can someone please help me out? I would really appreciate your help and hope that people who got the same issue can benefit as well from this.
hi @sadie2022 try removing cache and cookies or open in incognito mode or in private browser!
I’m sorry but did not really understand how this could help? Did I understand you right, you want me to open my store in an incognito window or a private browser?
Try to check your store in incongito window @sadie2022
Is there anything to edit in the code that could be done to remove this error?
Okay, I just tried this but unfortunately, it did not work out. Is there anything else I can do?
If it’s giving same issue in incongito window then we have to update Ajax JavaScript Framework to be coded properly with updated library not to have this issue but first try with incongito window
I tried several times to remove items from the cart page by using the incognito window but it did not work out. So how can I edit the Ajax JavaScript Framework? I would like to do it myself, I just need a little bit of advice.
Thanks for waiting
Here is everything
https://help.shopify.com/en/themes/development/templates/cart-liquid
Thank you so much. But could you tell me where exactly I need to put this on my cart.liquid ?
Here is my Code from the cart-liquid:
{{ page_title }}
| {{ 'cart.general.heading_product_name' | t }} | {{ 'cart.general.heading_unit_price' | t }} | {{ 'cart.general.heading_quantity' | t }} | {{ 'cart.general.heading_total' | t }} | |
|---|---|---|---|---|
|
{{ item.product.title }}
{% unless item.variant.title contains 'Default' %}
{{ item.variant.title }} {% endunless %} {% if settings.product_quantity_message and item.variant.inventory_management and item.variant.inventory_quantity <= 0 and item.variant.incoming %} {% assign property_size = item.properties | size %} {% if p.last contains ‘/uploads/’ %} {% endunless %} {% endfor %} {% endif %} |
{{ item.price | money }} |
|
{{ item.line_price | money }} |
Cart Totals
{% if cart.total_discounts > 0 %} {% assign savings = cart.total_discounts | money %}{{ 'cart.general.empty' | t }}
{{ 'cart.general.continue_browsing_html' | t }}
{% endif %}{{ ‘shipping-cart.js’ | asset_url | script_tag }}
{% endunless %}
You can find file cart.liquid in edit çode section left side of customize button in which we have theme files like layout template section etc you will find cart file there
No, I mean where in the cart file do I need to insert the code? At the bottom of the file or in a certain line?
you can replace cart.liquid fie from original theme you did install I would recommend!
Hi @sadie2022
Can you post a link to the site please?
Hard to diagnose this one without seeing it in action.
Thanks
Could you localize the issue?
Hi Sadie
Something up the chain looks like it’s overriding the listener for that click and doing something else with it instead.
Try replacing in your cart.liquid, these lines:
With these lines, you’ll notice there’s a new onclick attribute on the button that specifies a removal of that product, then refreshes the page:
And come back to let us know whether that works or not?
The first 3 times I tried removing items from the cart, using your code it worked but now it doesn’t! Do you have another idea of how to fix this?
Okay I just tried out adding a couple of products and then removing them and noticed that the code you provided ONLY works when only one product is in the cart
Hi @sadie2022
My apologies I used window instead of location and if we return false at the end it’ll prevent other event listeners from firing.
So replace:
with this code (notice the modified onclick attribute):
That should then work properly again?
Thank you very much. I will try this out and let you know if it worked out.
