Shopping Bag showing collections instead of product prices

New Member
2 0 0

Hi All,

Need help with coding this correctly. I have 2 issues.

 

Issue #1. When someone adds an item/multiple items from the same page, and they click on the shopping bag to preview, everything seems normal. They are able to see  the items they've added to their cart and the correct pricing.

See screenshot 1 below.

 

However, when the individual navigates to a different page and then clicks on the shopping bag to preview, they see the first item and a bunch of random links of collections I've created with the term "Collection".  

See screenshot 2 below

 

Pasting the code at the bottom to show where this issue is arising from with hopes this is an easy fix.

 

Issue #2. When someone clicks on the shopping bag from the home page, nothing happens. When you are on any other page, either the shopping bag will show what has been added to cart, or it shows that the cart is empty with a button to continue shopping.

 

Appreciate any help.

 

 

2.png

 

1.png

 

 

 

 

<div class="top-header" style="margin-left:30px">
              <div class="wrapper-top-cart">
                <p class="top-cart">
                  <a href="javascript&colon;void(0)" id="cartToggle">
                    <span class="first" {% if settings.enable_multilang %}data-translate="cart.general.shopping_cart"{% endif %}><i class="fa fa-shopping-bag hidden-xs" aria-hidden="true"></i></span>
                  </a>
                </p>
                <div id="dropdown-cart" style="display:none">
                  <div class="no-items">
                    <p>{{ 'cart.general.empty' | t }}</p>
                    <p class="text-continue"><a href="/collections/shop-all" {% if settings.enable_multilang %}data-translate="cart.ajax_cart.continue_shopping"{% endif %}>{{ 'cart.ajax_cart.continue_shopping' | t }}</a></p>
                  </div>
                  <div class="has-items">
                    <ol class="mini-products-list">
                      {% for item in cart.items | limit: 1 %}
                      <li class="item" id="cart-item-{{item.id}}">
                        <div class="wrapper">
                        <div class="product-image">
                          <img src="{{ item.image | product_img_url: 'small' }}" alt="{{item.title}}">
                        </div>
                        <div class="product-details">
                          {% for collection in item.product.collections %}
                          <a href="{{ collection.url }}"><h4><b>{{ collection.title }} Collection</b></h4></a>
                          {% endfor %}
                        </div>
                        </div>
                      </li>
                      {% endfor %}

                      {% for item in cart.items | offset: 3 | limit: 1 %}
                      <li class="item" id="cart-item-{{item.id}}">
                        <div class="wrapper">
                        <div class="product-image">
                          <img src="{{ item.image | product_img_url: 'small' }}" alt="{{item.title}}">
                        </div>
                        <div class="product-details">
                          {% for collection in item.product.collections %}
                          <a href="{{ collection.url }}"><h4><b>{{ collection.title }} Collection</b></h4></a>
                          {% endfor %}
                        </div>
                        </div>
                      </li>
                      {% endfor %}

                      {% for item in cart.items | offset: 6 | limit: 1 %}
                      <li class="item" id="cart-item-{{item.id}}">
                        <div class="wrapper">
                        <div class="product-image">
                          <img src="{{ item.image | product_img_url: 'small' }}" alt="{{item.title}}">
                        </div>
                        <div class="product-details">
                          {% for collection in item.product.collections %}
                          <a href="{{ collection.url }}"><h4><b>{{ collection.title }} Collection</b></h4></a>
                          {% endfor %}
                        </div>
                        </div>
                      </li>
                      {% endfor %}

                      {% for item in cart.items | offset: 9 | limit: 1 %}
                      <li class="item" id="cart-item-{{item.id}}">
                        <div class="wrapper">
                        <div class="product-image">
                          <img src="{{ item.image | product_img_url: 'small' }}" alt="{{item.title}}">
                        </div>
                        <div class="product-details">
                          {% for collection in item.product.collections %}
                          <a href="{{ collection.url }}"><h4><b>{{ collection.title }} Collection</b></h4></a>
                          {% endfor %}
                        </div>
                        </div>
                      </li>
                      {% endfor %}
                    </ol>
                    <div class="summary">
                      <p class="total">
                        <span class="label"><span {% if settings.enable_multilang %}data-translate="cart.label.total"{% endif %}>{{ 'cart.label.total' | t }}</span>:</span>
                        <span class="price">{{cart.total_price | money}}</span>
                      </p>
                    </div>
                    <div class="actions">
                      <button class="btn" onclick="window.location='/checkout'" {% if settings.enable_multilang %}data-translate="cart.general.checkout"{% endif %}>{{ 'cart.general.checkout' | t }}</button>
                    </div>
                    <p class="text-cart"><a href="/cart" {% if settings.enable_multilang %}data-translate="cart.general.view_cart"{% endif %}>{{ 'cart.general.view_cart' | t }}</a></p>
                  </div>
                </div>
              </div>
0 Likes
Highlighted
Shopify Expert
1353 111 181

Please Share a Store url to better assist.

Thanks & Regards
Perennial Solution

Problem Solved?✔️Like and Accept the solution that can help others.
Need any help with theme customization or design? Hire us
Shopify Expert Page: https://experts.shopify.com/perennialsolution
Email: infoperennialsolution@gmail.com
Skype: infoperennialsolution
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes