I have a custom size chart in my Shopify Store and when someone clicks on the size they want and then click the Add to Cart button I would like to have that size be added to the cart. However, right now I am unsure how I can accomplish this. Any ideas?
HTML
<div class="sizes">
{{ 'size-triangle.png' | asset_url | img_tag }}
{% for variant in product.variants %}
<a href="#" class="size-btn {{ variant.title }}-product {% if variant.inventory_quantity == 0 %}outofstock{% endif %} {% if variant.title contains 'OS'%}hide{% endif %}" data-quantity="{{ variant.available }}" data-id="{{ variant.id }}" data-size="{{ variant.title }}">{{ variant.title }}</a>
{% endfor %}
</div>
<div id="product-add">
<input class="button" type="submit" name="add" value="Add to cart" id="purchase">
</div>