Horizon Theme
Hoping anyone can shine some light. From reading other threads and scouring the web, I have learned how to pass a variable from variant-main-picker.liquid over to slideshow-controls.liquid. Long story short, trying to pass 1 variable (related to selected shirt size option) over from ‘variant’ file to my ‘slideshow’ file to use inside a href attached to my product thumbnails. So far I have done:
In variant-main-picker, I added the following code in bold:
{% if product_option_value.selected %}
checked
**{% capture size_id %}{{ product_option_value.id }}{% endcapture %}**
{% endif %}
and also used the following in the same file:
{% render ‘slideshow-controls’, size_id: size_id %}
Now if I hop over to the slideshow file and insert the following code at random on the page for testing results:
{{ size_id | json }}
it returns the following on my product page:
I assume it shows ‘null’ in there multiple times before showing the number I need because it is looping through all the sizes. But there lies the problem. I want to enter the {{ size_id }} elsewhere on the slidehow page into a URL string, but when I do that, it comes back completely empty. I can only assume that might be because it is using the first or last one of the iterations of null, instead of the ‘3770076725421’ that I need it to use in this particular case.
How can I use the {{ size_id }} in a href string and it not come up blank? Hope that made sense. Yes, I am very beginner at this, so please help in any way you can. Thanks.
PS - I even temporarily played around with if/then == ‘3770076725421’ for example, and it always comes up false. I think because when looking at {{ size_id }} it sees the null entries in there so no match??? HELPPPPPP


