Liquid code in Quantity Selector instead Of "1"

Solved

Liquid code in Quantity Selector instead Of "1"

victor6am
New Member
4 0 0

Hello,

We need to change the default quantity shown in selector, instead "1", to a product.metafield (related to Master case units).

 

<input aria-label="{{ 'products.product.quantity' | t }}" id="quantity" type="number" name="quantity" value="1" />

Any liquid variable we put in "quantity" doesn´t work. For example:

<input aria-label="{{ 'products.product.quantity' | t }}" id="quantity" type="number" name="quantity" value="{{ 'product.metafields.my_fields.master_case_pack' }}" />

my_fields.master_case_pack is an Integer metafiled

 

Anyone knows how we could do it?

Thank you in advanced,

 

Accepted Solution (1)

Guleria
Shopify Partner
3504 701 983

This is an accepted solution.

Here is the error
replace
value="{{ 'product.metafields.my_fields.master_case_pack' }}"
with 
value="{{ product.metafields.my_fields.master_case_pack }}"

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com
- Try GEMPAGES a great page builder
- If you want to help me please PAYPAL

View solution in original post

Replies 2 (2)

Guleria
Shopify Partner
3504 701 983

This is an accepted solution.

Here is the error
replace
value="{{ 'product.metafields.my_fields.master_case_pack' }}"
with 
value="{{ product.metafields.my_fields.master_case_pack }}"

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com
- Try GEMPAGES a great page builder
- If you want to help me please PAYPAL
victor6am
New Member
4 0 0

That is. Thank you very much for your help.

 

Now, we need to "recommend" when the quantity selected is menor than Quantity box. Which is the variable "quantity" to compare with product.metafields.my_fields.master_case_pack  ? I can´t find it in the code.

 

Thank you again