Custom add to cart button in Shopify.

You can create a custom add to cart button by using the code below.

Custom add to cart button in Shopify.expoundsofttechsolution Custom add to cart button in Shopify.

<form id="add-item-form" action="/cart/add" method="post">

{% comment %}
  {% if product.variants.size > 1 %}
  {% for option in product.options_with_values %}
  <div class="options">
    <div class="options_name">{{ option.name }}</div>
    <div class="variants-wrapper clearfix {% if product.variants.size == 1 %}visuallyhidden{% endif %}"> 
      <select id="product-select" name="id">
        {% for variant in product.variants %}
        <option value="{{ variant.id }}"
                {% if variant == product.selected_or_first_available_variant %}selected="selected"{% endif %}
                >
          {{ variant.title }} </option>
        {% endfor %}
      </select>
    </div>
  </div>
  {% endfor %}
  {% endif %}
{% endcomment %} 

   //  add you code here

  <input type="submit" id="add-to-cart" name="add" value="Add All Products to Cart" />
</form>

If you get any trouble while creating Add to Cart button, please leave your queries in the comment box. I am always eager to help you.