I’m looking to DRY this up.
- Performing a
forloop and organizing all collections A-Z while setting the current section withproduct_vendor | slice: 0works fine. - However, if a collection name starts with a number, then I’m not listing each as 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 - but assigning “0-9” as the section’s title.
The conditional is way too long-winded and would like to know how to refactor it.
{% if thisVendorDir == "0" or thisVendorDir == "1" or thisVendorDir == "2" or thisVendorDir == "3" or thisVendorDir == "4" or thisVendorDir == "5" or thisVendorDir == "6" or thisVendorDir == "7" or thisVendorDir == "8" or thisVendorDir == "9" %}
{% assign thisVendorDir = "0-9" %}
{% endif %}