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.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024