I’ve been trying to get this simple line of element/attribute from a selected option for several weeks but got no luck. I am pulling my hair out from this task. Please help.
I created a custom section: product-customizable-template.liquid
In here, a select dropdown option was added by the Products tool in Shopify.
Code:
{% form ‘product’, product, class:form_classes, novalidate: ‘novalidate’, data-product-form: ‘’ %}
{% unless product.has_only_default_variant %}
{% for option in product.options_with_values %}
{{ [option.name](http://option.name/) }}
{% endfor %}
{% endunless %}
My GOAL is to retrieve the data-sku value in this function.
sku: “axxxxxxxx”
Please help me eliminate my misery. Thank you !!