What can cause an error on the cart page?

Topic summary

Cart actions (add/remove) were not working and the cart page displayed the literal translation key “{{ ‘sections.cart.cart_error’ | t }}” instead of a message. The issue appeared when clicking Add to Cart resulted in no updates.

A helper requested the store URL and noted the message comes from the locale file (en), suggesting a translation/templating issue. The store owner shared the site (blissneck.com) and provided theme.liquid and a custom footer.js snippet that sets cart/variant strings using translation keys and includes multiple tracking scripts.

Another participant tested the live site and reported Add to Cart worked, sharing a screenshot as evidence.

The store owner then removed previous theme code and confirmed the cart now works.

Key details:

  • Shared code included custom scripts and locale-based strings for cart errors.
  • A screenshot was used to verify successful cart behavior.

Outcome: Resolved by removing prior theme code. Root cause wasn’t explicitly identified; likely tied to earlier theme customizations affecting cart functionality or translations. No further action requested.

Summarized with AI on January 10. AI used: gpt-5.

HI, hope you guys are doing well. I am facing an error in my cart page when i click to the add to cart button nothing added in my cart and if i add or delete nothing happend. the error it shows is “{{ ‘sections.cart.cart_error’ | t }}”. Kindly help me to solve only this error.

Hello @ahsan508 ,

Can you share me your website link so i figure out what exactly you facing issue, secondly you share code, text comes from locals en.

blissneck.com
this is the code in theme.liquid

{% capture cur %}{% include “booster-currency” %}{% endcapture %}{% unless cur contains “Liquid error” %}{{ cur }}{% endunless %}
{% render ‘gp-head’ %}

{% render ‘gem-app-header-scripts’ %}

{{ 'accessibility.skip_to_text' | t }}

{%- if settings.cart_type == ‘drawer’ -%}
{%- render ‘cart-drawer’ -%}
{%- endif -%}

{% sections ‘header-group’ %}

{{ content_for_layout }}

{% sections ‘footer-group’ %}

  • {{ 'accessibility.refresh_page' | t }}
  • {{ 'accessibility.link_messages.new_window' | t }}

{%- if settings.predictive_search_enabled -%}

{%- endif -%}

{% render ‘gem-app-footer-scripts’, GEM_FOOTER_SCRIPT: GEM_FOOTER_SCRIPT %}

this is the custom footer.js file code which is attached

window.shopUrl = ‘{{ request.origin }}’;
window.routes = {
cart_add_url: ‘{{ routes.cart_add_url }}’,
cart_change_url: ‘{{ routes.cart_change_url }}’,
cart_update_url: ‘{{ routes.cart_update_url }}’,
cart_url: ‘{{ routes.cart_url }}’,
predictive_search_url: ‘{{ routes.predictive_search_url }}’,
};

window.cartStrings = {
error: {{ 'sections.cart.cart_error' | t }},
quantityError: {{ 'sections.cart.cart_quantity_error_html' | t: quantity: '[quantity]' }},
};

window.variantStrings = {
addToCart: {{ 'products.product.add_to_cart' | t }},
soldOut: {{ 'products.product.sold_out' | t }},
unavailable: {{ 'products.product.unavailable' | t }},
unavailable_with_option: {{ 'products.product.value_unavailable' | t: option_value: '[value]' }},
};

window.quickOrderListStrings = {
itemsAdded: {{ 'sections.quick_order_list.items_added.other' | t: quantity: '[quantity]' }},
itemAdded: {{ 'sections.quick_order_list.items_added.one' | t: quantity: '[quantity]' }},
itemsRemoved: {{ 'sections.quick_order_list.items_removed.other' | t: quantity: '[quantity]' }},
itemRemoved: {{ 'sections.quick_order_list.items_removed.one' | t: quantity: '[quantity]' }},
viewCart: {{- 'sections.quick_order_list.view_cart' | t -}},
each: {{- 'sections.quick_order_list.each' | t: money: '[money]' }},
};

window.accessibilityStrings = {
imageAvailable: {{ 'products.product.media.image_available' | t: index: '[index]' }},
shareSuccess: {{ 'general.share.success_message' | t }},
pauseSlideshow: {{ 'sections.slideshow.pause_slideshow' | t }},
playSlideshow: {{ 'sections.slideshow.play_slideshow' | t }},
recipientFormExpanded: {{ 'recipient.form.expanded' | t }},
recipientFormCollapsed: {{ 'recipient.form.collapsed' | t }},
};

Hello @ahsan508 ,

I check website successfully add to cart screenshot attached.

I remove the previous theme code now its working