Why does the 'remove' button on the Fashe Theme cart page redirect to checkout?

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!

1 Like

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

1 Like

Is there anything to edit in the code that could be done to remove this error?

1 Like

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

@sadie2022

1 Like

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.

@sadie2022

Thanks for waiting

Here is everything

https://help.shopify.com/en/themes/development/templates/cart-liquid

1 Like

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

{% if cart.item_count > 0 %}
{% for item in cart.items %} {% endfor %}
{{ '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 date = item.variant.next_incoming_date | date: format: ‘month_day_year’ %}


{{ ‘products.product.will_not_ship_until’ | t: date: date }}
{% endif %}

{% assign property_size = item.properties | size %}
{% if property_size > 0 %}
{% for p in item.properties %}
{% if forloop.first %}
{% endif %}
{% unless p.last == blank %}
{{ p.first }}:

{% if p.last contains ‘/uploads/’ %}
{{ p.last | split: ‘/’ | last }}
{% else %}
{{ p.last }}
{% endif %}


{% endunless %} {% endfor %} {% endif %}
{{ item.price | money }}
{{ 'cart.general.remove' | t }}
{{ item.line_price | money }}
{{ 'cart.general.update' | t }}
Cart Totals
{% if cart.total_discounts > 0 %} {% assign savings = cart.total_discounts | money %}
{{ 'cart.general.discount' | t }}: {{ 'cart.general.savings_html' | t: price: savings }}
{% endif %}
Shipping:
{% include 'shipping-calculator' %}
{{ 'cart.general.subtotal' | t }}: {{ cart.total_price | money }}
{{ 'cart.general.proceed_checkout' | t }} {% if additional_checkout_buttons %} {{ content_for_additional_checkout_buttons }} {% endif %}
{% else %}

{{ 'cart.general.empty' | t }}

{{ 'cart.general.continue_browsing_html' | t }}

{% endif %}
{% unless settings.shipping_calculator == 'Disabled' %}

{{ ‘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

@sadie2022

1 Like

@Ecommpremium

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?

1 Like

you can replace cart.liquid fie from original theme you did install I would recommend!

@sadie2022

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?

1 Like

@SB_90

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?

@SB_90

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?

1 Like

Thank you very much. I will try this out and let you know if it worked out.