This is an advanced tutorial and is not supported by Shopify. Knowledge of HTML, CSS, JavaScript, and Liquid is required. Consider hiring a Shopify Expert if you aren’t comfortable doing the steps in the tutorial.
Caution
This customization does not work with Shopify sectioned themes, nor with non-sectioned versions of Brooklyn and Venture. Trying to enable this customization on an incompatible theme can cause errors in your Shopify admin when previewing your theme. If you need this customization and use an incompatible theme, consider hiring Shopify Expert to implement it for you.
Update secondary menus in line with the current selection, to avoid showing unavailable combinations of options when a customer is choosing from multiple menus. In short, you don’t want your customers to encounter this:
When your store’s visitors make a selection in the first drop-down, you want the values in the second drop-down right below to be updated to list only those values that are available in combination with their first selection.
If a product has three options, you want the same to happen when one selects a value in the second drop-down. You want the values in the third drop-down to be updated to only list values that are available in combination with the two selections made above.
This works from top to bottom. Think of the typical “select a country then select a town” scenario. Selecting a country in the first country element updates the second town element to only contain towns found in that country.
Shopify does not give you linked options out of the box. It makes all choices in all drop-downs available. For example, all possible sizes will be listed in your Size drop-down and all colors will be listed in your Color drop-down, regardless what combinations exist or are in stock.
Linked options can be added to your theme in two steps.
From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, and then click Actions > Edit code.
I am very new to this but i followed the instructions exactly as posted and it is still offering options and showing them as unavailable. I am using the venture theme if that matters. Thank you in advance for your assistance.
Has anyone been able to find a workaround with this for Themes where it doesn’t work? Im currently using the Warehouse theme from Maestroo and it does not work with square icons or drop down list. Please help lol
I am looking for a solution to this problem for Debut theme.
I really believe this should be solved by Shopify already, i have seen many post on this same subject, and it simply makes no sense to display options that are not available.
Not yet. I might check it out and see how it works.
For now, I’ve gone to my translations and I’ve changed “Unavailable” to “Invalid product combination” as well as labeling the options a little more clearly so the user can understand which sizes in Menu 2 apply to each of the selections from Menu 1.
So i followed the youtube above then did wot fella described (im using the narrative theme FYI):
"For those of you who are having issues with the default variant not loading and requiring the user to select a variant before the script fires:
This is what worked for me on the Shopify Debut Theme.
Find the following code:
Shopify.linkOptionSelectors({{ product | json }});
It is located in the following if statement
{% if product.available and product.options.size > 1 %}
...
Shopify.linkOptionSelectors({{ product | json }});
...
{% endif %}
Simply move it directly outside of the if statement:
{% if product.available and product.options.size > 1 %}
...
// Line removed from here
...
{% endif %}
// Line added here
**Shopify.linkOptionSelectors({{ product | json }});**
& badabing badaboh!
SKILLz, cash monies dollar dollar bills coming my way (quickly converted to $btc & $doge ; )
I got this to partially work with a 3rd party theme that uses buttons instead of dropdowns. In the first option, all the buttons change their color to indicate they have been clicked but if I changes to any other value in the first option, the buttons don’t light up on the 2nd and 3rd options. Where should I look? Anyone else encounter this or know what to change?