Limit the number of options in the drop down menu

Hey

Is there a way to limit the number of options in the drop down menu.

I would like

-Sweden

-Norway

  • Eu

  • International

Instead of all countries listen in a long tedious list.

You could use max_blocks something similar to this but with the country images

{% assign max_blocks = 4 %} {% for product in collection.products limit: max_blocks %} {%- if product.available -%}

{%- if product == settings or settings == blank -%} {{product[image]}} // image is a handle of your theme’s asset file field, ex: “featured-image” . This will give you the src URL of the first image variant associated with a given Product model instance (in this case it would be all Products that are in your Collection). You need to output an HTML IMG tag here and set its SRC to this value (which is basically just like doing what liquid already does for you when using something like {{ img _src }}) If there are no images on the Product then nothing will be rendered since null/false checks always fail by default in Liquid evaluation.. If you want to show some kind of placeholder when there are no images then add an ELSE condition after this IF and handle that case there. {% else %} {{ product[image] | img_tag }} // this will give you the IMG tag for the first image variant associated with a given Product model instance (in this case it would be all Products that are in your Collection) . If there are no images on the Product then nothing will be rendered since null/false checks always fail by default in Liquid evaluation.. If you want to show some kind of placeholder when there are no images then add an ELSE condition after this IF and handle that case there. {%- endif -%} // end of handling different settings objects being available or not. You can ignore all of this if you don’t care about having different settings objects available depending on where the code is being called from (ex: collection vs product template).

{{product[name]}}

{%- if compare_at_price > price -%} {{ ‘products.product.on_sale’ | t }} {%- endif -%} {{ product[price] | money }}
{%- endif -%} {% endfor %}

Hey!

Thank you very much for your swift answer. So glad that Shopify has an active community. :smiley:

Unfortunately I can’t code.

:smiley:

Okay thank you.

Let me just figure out what markets I want included.