Dawn Theme - Changing Default product increments and multiples via template

Solved
Ricky_Strike
Tourist
3 1 0

Hi All, would really appreciate someones help!

 

I've been having issues creating templates for different product types, that require various minimum quantities and increments, 

 

I've set the overall default to 12 in the main.product file with the below code, however a few products require different volumes, 6 packs of beer etc, 3 bottles of rum

 

How can I set these values at the product template level? Then assign templates to product types rather than the main file?

 

 

main.product-

 

<input class="quantity__input"
type="number"
name="quantity"
id="Quantity-{{ section.id }}"
min="12"
value="12"
step="12"
form="{{ product_form_id }}"
>

Accepted Solution (1)
Ricky_Strike
Tourist
3 1 0

This is an accepted solution.

 

****** UPDATED********

I was able to get it working now using a plugin that adds metafields for non flow stores, I imagine it's a long way round, but it's working for now!

 

 

Thank you for your help,

 

I've tried to define and call the metafield to replace the min/value/step in the theme files, however I still have no luck. 

 

If I input a single value, it works fine, but seemingly not the product metafield,

 

Is there a step I may have missed? 

 

Thanks

View solution in original post

Replies 4 (4)
Guleria
Shopify Partner
2250 466 687

Hello @Ricky_Strike ,

Add a metafield definition for products named 'Product min quantity' or whatever you want.
After this you will find with every product there is an option available to define the value.

Now in next step call that metafield e.g.

min="{{ metafield }} "
value="{{ metafield }} "
step="{{ metafield }} "

 

Thanks

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1

Try GEMPAGES a great app with drag and drop features to design landing/product/individual pages.
Ricky_Strike
Tourist
3 1 0
Hey,

Thanks for the response!

Forgive my ignorance, but where are the fields defined for the product? In
the main.product code or elsewhere?

Really appreciate your help, was driving me crazy!
Guleria
Shopify Partner
2250 466 687

1) Add metafield for product ( Settings -> metafield ) 
For more details follow the URL 
https://help.shopify.com/en/manual/shopify-plus/flow2/reference/actions/add-product-metafield

2) Edit theme file and call metafield ( in place of min, value and step )

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1

Try GEMPAGES a great app with drag and drop features to design landing/product/individual pages.
Ricky_Strike
Tourist
3 1 0

This is an accepted solution.

 

****** UPDATED********

I was able to get it working now using a plugin that adds metafields for non flow stores, I imagine it's a long way round, but it's working for now!

 

 

Thank you for your help,

 

I've tried to define and call the metafield to replace the min/value/step in the theme files, however I still have no luck. 

 

If I input a single value, it works fine, but seemingly not the product metafield,

 

Is there a step I may have missed? 

 

Thanks