What can cause an error on the cart page?

ahsan508
Visitor
3 0 0

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.

Replies 4 (4)

iffikhan30
Shopify Partner
246 35 44

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.

 

 

Custom theme and app [remix] expert.
Buy me a Coffee
Email: irfan.sarwar.khan30@gmail.com
Chat on WhatsApp
ahsan508
Visitor
3 0 0

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' %}
<!--Gem_Page_Header_Script-->
{% render 'gem-app-header-scripts' %}
<!--End_Gem_Page_Header_Script-->
</head>
<body class="gradient{% if settings.animations_hover_elements != 'none' %} animate--hover-{{ settings.animations_hover_elements }}{% endif %}">
    <a class="skip-to-content-link button visually-hidden" href="#MainContent">
      {{ 'accessibility.skip_to_text' | t }}
    </a>
 
    {%- if settings.cart_type == 'drawer' -%}
      {%- render 'cart-drawer' -%}
    {%- endif -%}
 
    {% sections 'header-group' %}
 
    <main id="MainContent" class="content-for-layout focus-none" role="main" tabindex="-1">
      {{ content_for_layout }}
    </main>
 
    {% sections 'footer-group' %}
 
    <ul hidden>
      <li id="a11y-refresh-page-message">{{ 'accessibility.refresh_page' | t }}</li>
      <li id="a11y-new-window-message">{{ 'accessibility.link_messages.new_window' | t }}</li>
    </ul>
 
    <script>
 
      <script>
  rdt('track', 'Purchase', {
      "currency": "USD",
      "itemCount": 1,
      "transactionId": "12345678",
      "value": 100,
      "products": [
          {
              "id": "product id 1",
              "name": "product name 1",
              "category": "product category 1"
          },
// additional products can be added here
      ]
  });
</script>
 
    <script>
  rdt('track', 'AddToCart', {
      "currency": "USD",
      "itemCount": 1,
      "value": 100,
      "products": [
          {
              "id": "product id 1",
              "name": "product name 1",
              "category": "product category 1"
          },
// additional products can be added here
      ]
  });
</script>
 
    <script>
  rdt('track', 'AddToWishlist', {
      "currency": "USD",
      "itemCount": 1,
      "value": 100,
      "products": [
          {
              "id": "product id 1",
              "name": "product name 1",
              "category": "product category 1"
          },
// additional products can be added here
      ]
  });
</script>
 
    <script>
  rdt('track', 'Lead', {
      "currency": "USD",
      "transactionId": "12345678",
      "value": 100,
      "products": [
          {
              "id": "product id 1",
              "name": "product name 1",
              "category": "product category 1"
          },
// additional products can be added here
      ]
  });
</script>
 
    <script>
  rdt('track', 'SignUp', {
      "currency": "USD",
      "transactionId": "12345678",
      "value": 100,
      "products": [
          {
              "id": "product id 1",
              "name": "product name 1",
              "category": "product category 1"
          },
// additional products can be added here
      ]
  });
</script>
 
    <script>
  rdt('track', 'PageVisit', {
      "products": [
          {
              "id": "product id 1",
              "name": "product name 1",
              "category": "product category 1"
          },
// additional products can be added here
      ]
  });
</script>
 
    <script>
  rdt('track', 'ViewContent', {
      "products": [
          {
              "id": "product id 1",
              "name": "product name 1",
              "category": "product category 1"
          },
// additional products can be added here
      ]
  });
</script>
 
    <script>
  rdt('track', 'Search', {
      "products": [
          {
              "id": "product id 1",
              "name": "product name 1",
              "category": "product category 1"
          },
// additional products can be added here
      ]
  });
</script>
 
    <script>
  rdt('track', 'Custom', {
      "customEventName": "Your_Event_Name",
      "currency": "USD",
      "itemCount": 1,
      "transactionId": "12345678",
      "value": 100,
      "products": [
          {
              "id": "product id 1",
              "name": "product name 1",
              "category": "product category 1"
          },
// additional products can be added here
      ]
  });
</script>
 
    <script>
rdt('track', 'PageVisit');
</script>
 
    <script>
rdt('track', 'ViewContent');
</script>
 
    <script>
rdt('track', 'Search');
</script>
 
    <script>
rdt('track', 'AddToCart');
</script>
 
    <script>
rdt('track', 'AddToWishlist');
</script>
 
    <script>
rdt('track', 'Purchase');
</script>
 
    <script>
rdt('track', 'Lead');
</script>
 
    <script>
rdt('track', 'SignUp');
</script>
          <script src="{{ 'custom footer.js' | asset_url }}"></script>
  </script>
 
    {%- if settings.predictive_search_enabled -%}
      <script src="{{ 'predictive-search.js' | asset_url }}" defer="defer"></script>
    {%- endif -%}
  <!--Gem_Page_Footer_Script-->
{% render 'gem-app-footer-scripts', GEM_FOOTER_SCRIPT: GEM_FOOTER_SCRIPT %}
<!--End_Gem_Page_Footer_Script-->
 
</body>
</html>

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 }}`,
};

iffikhan30
Shopify Partner
246 35 44

Hello @ahsan508 ,

 

I check website successfully add to cart screenshot attached.

 

iffikhan30_0-1702720394610.png

 

Custom theme and app [remix] expert.
Buy me a Coffee
Email: irfan.sarwar.khan30@gmail.com
Chat on WhatsApp
ahsan508
Visitor
3 0 0

I remove the previous theme code now its working