Do you think this code is slow?

Hi,

I'm thinking about adding something like this to my product page instead of setting up variants, which usually generates 2 or 3 results always less than 20 and sometimes 0.

Do you think this will slow down my product page drastically?

 

 

 

{% assign group = product.handle | split: '-' | first %}
<select>
<option>
{% for product in collection['all'].products %}
{{ all_products[group].title | split: '|' | last }}
{% endfor %}
</option>
</select>

 

 

 

 thanks

-Like and Mark as an Accepted Solution if my reply is helpful
I'm not an expert, these are my own experiences or codes that I gathered from others. I'm using Debut.
I have my own online pet supply store check it out at
PETLANTIS.CA
0 Likes
AvidBrio
Shopify Expert
125 6 12

yes this will make some minor differences  does use split two-time use one loop and set default selected as the index 0  else in item In select  option

{% for product in collections.frontpage.products %}
  {{ forloop.index0 }}
{% endfor %}

 

If you find our comment helpful, hit the like button and accept it as a solution.
Want us to implement custom changes in your store? Contact us
Email me directly - jim@avidbrio.com
0 Likes