Shopify themes, liquid, logos, and UX
How can I identify the variant clicked for size pills, to use that variants size as a button text?
I have built an extension of the product-variant-picker and product-variant-options to include a drawer design of the sizes. So if I pick "Combo" (added choice next to pills or dropdown) in my admin of variant picker block I get a button named "Pick Size" (in storefront) and if I pick that I get a modal drawer animating in from the side showing all variants sizes. So far pretty simple and working as intended.
Problem I'm unable to solve is that when I click any of the size variants in that list I need to find the variable or state of that variant so I also can write a conditional statement of the button "Pick size" text, to after a variatn size is clicked, display that variants size inside the button.
In short, how can I change the text "Pick size" to "XL" if I click a variants size named "XL?
Hope I explain this clear enough, my own head is spinning 🙂
Solved! Go to the solution
This is an accepted solution.
I actually managed to solve it myself with a little help of ChatGPT.
This is an accepted solution.
I actually managed to solve it myself with a little help of ChatGPT.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025