A space to discuss online store customization, theme development, and Liquid templating.
Edit: Oh dear, it appears I've posted this in the wrong section of the forum, I was sent here by Shopify Support. I am sorry.
Hi everyone,
I seem to have come across an error when working with the range input increments / steps on the Dawn theme.
I've verified that the code works in increments of 2, 5 and other numeric values but it does not seem to work in increments of 1. I get an error that says,"Error: Invalid schema: setting with id="free_shipping_threshold" step invalid. Range settings must have at most 101 steps".
I have added a screenshot of it as well incase that helps.
In the documentation there is an example of some code that demonstrates steps / increments of 1 so it seems that it's very possible to do. I'm unsure of where I'm going wrong here or if it's a bug that is out of my control. Has anyone else encountered anything similar to this and if so, were you able to overcome it?
Below I've added some images and code related to this issue incase it helps illustrate the problem.
Reference documentation (https://shopify.dev/themes/architecture/settings/input-settings#range).
Error that pops up when the increment is changed to the value of 1:
Code snippet with the increment / step set to 1.
{
"type":"range",
"id":"free_shipping_threshold",
"label": "threshold for free shipping",
"min":0,
"max":200,
"step":1,
"unit":"$",
"default":50
}
Any help would be greatly appreciated.
Solved! Go to the solution
This is an accepted solution.
Hi @Roman-eComplete,
There is a minimum step you only do. I believe it is only around 100 as far as I remember, but try this code below. I change the max to 100.
{
"type":"range",
"id":"free_shipping_threshold",
"label": "threshold for free shipping",
"min":0,
"max":100,
"step":1,
"unit":"$",
"default":50
}
This is an accepted solution.
Hi @Roman-eComplete,
There is a minimum step you only do. I believe it is only around 100 as far as I remember, but try this code below. I change the max to 100.
{
"type":"range",
"id":"free_shipping_threshold",
"label": "threshold for free shipping",
"min":0,
"max":100,
"step":1,
"unit":"$",
"default":50
}
This did not work when I made the change on my working branch but it seemed to work when I made a new branch and tried it so thank you for the help! I will accept this as the solution, thank you again! 🙂
If you need to update the block, especially with range, you have to remove the block first from the theme editor. This will unlink the block from the code and once you add it again, the updates should show.
And you can also add a new link block, and delete the previous one