How to change a 'Label' in the cart using metafields

How to change a 'Label' in the cart using metafields

SMStech
Shopify Partner
2 0 1

Hello All,

I need to customize the 'Quantity' label on both my product page and the cart page. Not sure if it matters, but I am using the Minimal theme.

 

I have successfully used a metafield to customize the Quantity label on the product page using a varient as follows:

 

 

{% assign qty_discription = product.metafields.custom.description_quantity %}
{% if qty_discription == blank %}
{% assign qty_discription = Quantity %}
{% endif %}
<label for="Quantity">{{ qty_discription }}</label>

 

 

Screenshot Product Page Quantity Label#1.png

 

However, the cart is using a different approach with the code and I am not sure how to make a metafield varient work.  Here is the current code from the cart:

 

Screenshot Cart label code.png

Screenshot Cart Quantity Label#2.png

To summarize my question:

  • Can I use a metafield to customize the Quantity label in the cart?
  • If so, how would I code that?
  • If not, is there another way to allow variable text in that field?

Thank you so much in advance!

Replies 0 (0)