Shopify themes, liquid, logos, and UX
Hi,
We have a mini cart liquid file, we can display quantity by using rv-text="item.quantity", but if we used {{item.quantity}}, it will display 0. after added
{% for item in cart.items %}, we can only display the first product quantity.
How can we change the code here?
thanks
Abby
{% for item in cart.items %}
<div id="cart-drawer" class="block block-cart">
<a href="javascript:void(0);" class="close-cart"><i class="ad ad-times-r " aria-hidden="true"></i></a>
<h4>{{ 'cart.general.title' | t }}</h4>
<ul class="mini-products-list" data-cart-view="data-cart-view">
<li id="cart-title" rv-show="cart.item_count | lt 1">{{ 'cart.general.empty' | t }}</li>
<li class="grid" rv-each-item="cart.items">
<a class="grid__item one-third medium-up--one-quarter product-image" rv-href="item.url"><img rv-src="item.image" rv-alt="item.title" /></a>
<div class="grid__item two-thirds medium-up--three-quarters product-details">
<a href="#" class="remove" rv-data-cart-remove="index | plus 1"><i class="ad ad-times-sql" aria-hidden="true"></i></a>
<a class="pName" rv-href="item.url" rv-text="item.product_title"></a>
<div class="vropts" rv-text="item.variant_title"></div>
<ul rv-hide="item.propertyArray | empty">
<li rv-each-property="item.propertyArray < properties"><small class="text-muted">{property.name}: {property.value}</small></li>
</ul>
<div class="priceRow"><span class="product-price" rv-html="item.price|money"></span>
<br>
{{ 'products.product.quantity' | t }}: <span rv-text="item.quantity"></span> Box
<br> SQM: <span>{{item.quantity}}</span> <span class="price-unit">m<sub>2</sub></span>
</div>
</div>
</li>
<li class="cart-subtotal-row flex" rv-show="cart.item_count | gt 0"> <span>{{ 'cart.general.subtotal' | t }}:</span> <span class="product-price" rv-html="cart.total_price | money currency.currentCurrency"></span></li>
<li class="buttonSet" rv-show="cart.item_count | gt 0">
{%- if settings.free_ship_minicart and settings.free_ship != blank and settings.free_ship_msg != blank -%}
{%- assign shipProd = all_products[settings.free_ship] -%}
<p id="freeShipMsg" class="freeShipMsg" data-price="{{shipProd.price}}"><i class="ad ad-truck-l"></i> {{settings.free_ship_msg | replace: '$','<b class="freeShip"></b>' }}</p>
<p id="freeShipclaim" class="freeShipMsg freeShipclaim"><i class="ad ad-truck-l"></i> {{settings.got_free_ship }}</p>
{%- endif -%}
{%- if settings.terms_checkbox -%}
<div class="cart_tearm">
<input type="checkbox" name="tearm" id="cartDWtearm" class="checkbox" value="tearm" required />
<label for="cartDWtearm"><span class="checkbox"></span> {{ settings.terms_text}}</label>
</div>
{%- endif -%}
<form action="/cart" method="post" novalidate>
<input type="submit" name="checkout" id="cartDWcheckout" class="btn cartDWcheckout" value="{{ 'cart.general.checkout' | t }}" {% if settings.terms_checkbox %}disabled="disabled"{% endif %} />
</form>
<a id="inlinecheckout-cart" href="/cart" class="btn btn--secondary">{{ 'cart.general.view_cart' | t }}</a>
</li>
</ul>
</div>
{% endfor %}
Please Share a Store url to better assist.
Hi, This is our store URL : https://tilehaus.co.nz/, PW: fowmea
by using <span rv-text="item.quantity"></span>, we can display the qunatity.
on the second line, we tried to use {{item.quantity | times: "vaule" }}, But it can only display the quantity for the first product.
Thanks
Abby
https://ui-elements-generator.myshopify.com/pages/cart-attribute
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024