title: Creating a second addtocart button/form Shopify
body: <p>I am using Shopify and have managed to add a second 'addtocart' button on the page so that people can order a sample.  Each product has 2 variants - 1st = Meterage, which they can then choose a quantity for, and 2nd = sample, which doesn't have a quantity box, it is linked to the button to automatically add 1.</p>
  
  <p>This was working fine, however we don't want it so that after a person adds something to cart, either the meterage or the sample, they are taken to the cart page.  Instead they stay on the product page and the minicart is updated.  </p>
  
  <p>The theme has this functionality and works great on the first button (the one that is linked to the meterage) however if I try and copy the first button to the sample button (i.e. its class name, etc) then when you click on it, it adds meterage and whatever quantity is in the quantity field, rather than adding 1 sample.</p>
  
  <p>I have tried copying the javascript and adding a new class, I have tried creating a new section as I thought it would be linked to this, but nothing is working.  All I want to do is if someone clicks on the 'order a sample' button then they stay on the product page and the minicart is updated.  Unfortunately I am a complete novice when it comes to javascript and so I just can't work this out.</p>
  
  <p>Here is the liquid coding for the product page:</p>
  
  <pre><code>    &lt;section id="product-area" class="clearfix" itemscope itemtype="http://schema.org/Product" data-product-id="{{ product.id }}"&gt;
  
      &lt;meta itemprop="url" content="{{ shop.url }}{{ product.url }}" /&gt;
      {% if settings.show-brand-names %}
        &lt;meta itemprop="brand" content="{{ product.vendor }}" /&gt;
      {% endif %}
      &lt;meta itemprop="name" content="{{ product.title }}"&gt;
  
      &lt;div class="showcase product-images"&gt;
        &lt;div class="container {% if product.images.size == 1 or settings.product-thumb-orientation == 'below' or settings.product-thumb-orientation == 'list' %}wide{% endif %}"&gt;
          &lt;div class="product-main-image wrap"&gt;
            {% unless settings.product-thumb-orientation == 'list' %}
              {% assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image %}
              &lt;img itemprop="image" alt="{{ featured_image.alt }}" src="{{ featured_image | img_url: 'original' }}"&gt;
              {% if settings.product-image-borders %}&lt;span class="overlay"&gt;&lt;/span&gt;{% endif %}
            {% else %}
              {% for image in product.images %}
                &lt;div class="image-list-item"&gt;
                  &lt;img itemprop="image" alt="{{ image.alt }}" src="{{ image | img_url: 'original' }}"&gt;
                  {% if settings.product-image-borders %}&lt;span class="overlay"&gt;&lt;/span&gt;{% endif %}
                &lt;/div&gt;
              {% endfor %}
            {% endunless %}
  
            {% if settings.product-image-zoom %}
              &lt;div class="product-zoom"&gt;&lt;/div&gt;
            {% endif %}
          &lt;/div&gt;
        &lt;/div&gt;
  
        {% if product.images.size &gt; 1 and settings.product-thumb-orientation != 'list' %}
          &lt;div class="pager {% if settings.product-thumb-orientation == 'below' %}below-main-image{% endif %}"&gt;
            &lt;div class="inner"&gt;
              {% for image in product.images %}
                &lt;div class="wrap thumb {% include 'for-looper' %} {% if forloop.first %}active{% endif %}"&gt;
                  &lt;img alt="{{ image.alt }}" src="{{ image.src | product_img_url: 'small' }}" data-high-res-url="{{ image.src | product_img_url: 'original' }}"&gt;
                  &lt;span class="overlay"&gt;&lt;/span&gt;
                &lt;/div&gt;
              {% endfor %}
            &lt;/div&gt;
          &lt;/div&gt;
        {% endif %}
  
        {% if settings.display-fullsize-product-viewer %}
          &lt;div class="notes"&gt;
            &lt;a href="#" class="toggle-fullview"&gt;&lt;span class="icon"&gt;l&lt;/span&gt;{{ 'products.product.view_fullsize_image' | t }}&lt;/a&gt;
          &lt;/div&gt;
        {% endif %}
        {% if settings.display-product-email-link %}
          &lt;div class="notes"&gt;
            &lt;a href="mailto:{{ shop.email }}?Subject={{ product.title | escape }}" class="email-us"&gt;&lt;span class="icon"&gt;j&lt;/span&gt;{{ 'products.product.email_us' | t }}&lt;/a&gt;
          &lt;/div&gt;
        {% endif %}
        {% if settings.enable-fitting-guide %}
          &lt;div class="notes"&gt;
            &lt;a href="/pages/{{ settings.fitting-guide-link }}" class="fitting-guide"&gt;&lt;span class="icon"&gt;{{ settings.fitting-guide-icon }}&lt;/span&gt;{{ 'products.product.fitting_guide' | t }}&lt;/a&gt;
          &lt;/div&gt;
        {% endif %}
      &lt;/div&gt;
  
      &lt;div class="product-details-wrapper"&gt;
      &lt;div class="product-details {% if product.images.size &gt; 1 %}border{% endif %} {% if product.variants.size == 1 and settings.display-product-quantity-option == false %}no-options{% endif %}" itemprop="offers" itemscope itemtype="http://schema.org/Offer"&gt;
  
        &lt;div class="module header"&gt;
          {% if settings.show-brand-names %}
            &lt;h3 class="brand"&gt;{{ product.vendor }}&lt;/h3&gt;
          {% endif %}
          &lt;h1 itemprop="name" class="title"&gt;{{ product.title }}&lt;/h1&gt;
  &lt;meta itemprop="priceCurrency" content="{{ shop.currency }}" /&gt;
          {% if product.selected_or_first_available_variant.compare_at_price &gt; product.selected_or_first_available_variant.price %}
            &lt;p class="price sale"&gt;&lt;span class="original money"&gt;{{ product.selected_or_first_available_variant.compare_at_price | money }}&lt;/span&gt; &lt;span class="money mets" itemprop="price"&gt;{{ product.selected_or_first_available_variant.price | money }}&lt;/span&gt;&lt;/p&gt;
          {% else %}
            &lt;p class="price"&gt;&lt;span class="money mets" itemprop="price"&gt;{{ product.selected_or_first_available_variant.price | money }}&lt;/span&gt;&lt;/p&gt;
          {% endif %}
        &lt;/div&gt;
  
        &lt;div class="module options {% unless product.available %}unavailable{% endunless %}"&gt;
          &lt;h3 style="text-transform: uppercase;"&gt;Order by the metre&lt;/h3&gt;
  
  {% if product.available %} 
  
  &lt;!-- If the product is available then... --&gt;
          &lt;link itemprop="availability" href="http://schema.org/InStock" /&gt;
          &lt;form class="product-form" id="product-form" action="/cart/add" method="post"&gt;
  
            &lt;input type="hidden" name="id" class="product-select" value="{{ product.selected_or_first_available_variant.id }}" data-variant-title="{{ product.selected_or_first_available_variant.title }}" /&gt;
  
            &lt;div id="infiniteoptions-container" class="side-labels"&gt;&lt;/div&gt;
            &lt;div id="uploadery-container" class="side-labels"&gt;&lt;/div&gt;
  
  
              &lt;div class="selector-wrapper quantity" style="margin-bottom: 0;"&gt;
                &lt;p&gt;Quantity &amp;nbsp;&lt;select id="quantity" class="drops" name="quantity"&gt;
  {% for i in (2..30) %}
  &lt;option value="{{ i }}"&gt;{{ i }}&lt;/option&gt;
  {% endfor %}
  &lt;/select&gt; metres&lt;/p&gt;
                &lt;p&gt;&lt;em&gt;Minimum 2 metres. Whole metres only&lt;/em&gt;&lt;/p&gt;
              &lt;/div&gt;
  
            &lt;div class="selector-wrapper submit-wrapper"&gt;
              {% if product.options.size &gt; 1 %}&lt;label&gt;&lt;/label&gt;{% endif %}&lt;input type="submit" class="action-button submit" value="{{ 'products.product.add_to_cart' | t }}"&gt;
            &lt;/div&gt;
  
          &lt;/form&gt;
          {% else %}
  
            &lt;link itemprop="availability" href="http://schema.org/OutOfStock" /&gt;
            &lt;span class="action-button unavailable disabled"&gt;{{ 'products.product.sold_out' | t }}&lt;/span&gt;
  
          {% endif %}
          &lt;hr style="width: 50%; margin: 20px 25%;" /&gt;
          &lt;h3 style="text-transform: uppercase; padding-bottom: 15px;"&gt;Order a free sample&lt;/h3&gt;
      &lt;form class="sample-form" id="sample-form" method="post" action="/cart/add"&gt;
      &lt;input type="hidden" name="id" value="{{ product.variants.last.id }}" data-variant-title="{{ product.variants.last.title }}" quantity="1"/&gt;
      &lt;input type="submit" class="action-button" value="{{ 'products.product.add_to_cart' | t }}" /&gt;
    &lt;/form&gt; 
          &lt;p&gt;&lt;em&gt;Max. 5 samples per order&lt;/em&gt;&lt;/p&gt;
        &lt;/div&gt;
  
        {% if product.description.size &gt; 0 %}
        &lt;div class="module description"&gt;
          &lt;div class="rte" itemprop="description"&gt;{{ product.description }}&lt;/div&gt;
        &lt;/div&gt;
        {% endif %}
  
      &lt;/div&gt;
      &lt;/div&gt;
  
    &lt;/section&gt;
  </code></pre>
  
  <p>And then the Quickshop coding (as this needs to be implemented on there as well)</p>
  
  <pre><code>    &lt;div id="quick-shop-{{ itemType.id }}" class="quick-shop-content clearfix" {% if itemType.options.size == 1 %}data-option="{{ itemType.options.first | escape }}"{% endif %}&gt;
  
    &lt;div class="showcase {% if itemType.images.size == 1 %}wide{% endif %}"&gt;
      &lt;div class="container {% if itemType.images.size == 1 or settings.product-thumb-orientation == 'below' %}wide{% endif %}"&gt;
        &lt;div class="wrap"&gt;
          &lt;img alt="{{ firstVariantImage.alt }}" src="{{ firstVariantImage | product_img_url: 'large' }}"&gt;
          {% if settings.product-image-borders %}&lt;span class="overlay"&gt;&lt;/span&gt;{% endif %}
        &lt;/div&gt;
      &lt;/div&gt;
  
      {% if itemType.images.size &gt; 1 %}
        &lt;div class="pager {% if settings.product-thumb-orientation == 'below' %}below-main-image{% endif %}"&gt;
          &lt;div class="inner"&gt;
            {% for image in itemType.images %}
              &lt;div class="wrap thumb {% include 'for-looper' %} {% if forloop.first %}active{% endif %}"&gt;
                &lt;img alt="{{ image.alt }}" src="{{ image.src | product_img_url: 'small' }}" data-high-res-url="{{ image.src | product_img_url: 'large' }}"&gt;
                &lt;span class="overlay"&gt;&lt;/span&gt;
              &lt;/div&gt;
            {% endfor %}
          &lt;/div&gt;
        &lt;/div&gt;
      {% endif %}
  
      {% if settings.display-product-email-link %}&lt;div class="notes"&gt;&lt;a href="mailto:{{ shop.email }}?subject={{ itemType.title | escape }}" class="email-us"&gt;&lt;span class="icon"&gt;j&lt;/span&gt;{{ 'products.product.email_us' | t }}&lt;/a&gt;&lt;/div&gt;{% endif %}
    &lt;/div&gt;
  
    &lt;div class="product-details-wrapper {% if itemType.variants.size == 1 and settings.display-product-quantity-option == false %}no-options{% endif %}"&gt;
  
      &lt;div class="module header"&gt;
        &lt;span class="close-modal"&gt;v&lt;/span&gt;
        {% if settings.show-brand-names %}
          &lt;p class="brand"&gt;{{ itemType.vendor }}&lt;/p&gt;
        {% endif %}
        &lt;p class="title"&gt;&lt;a href="{{ itemType.url }}"&gt;{{ itemType.title }}&lt;/a&gt;&lt;/p&gt;
        {% if product.selected_or_first_available_variant.compare_at_price &gt; product.selected_or_first_available_variant.price %}
            &lt;p class="price sale"&gt;&lt;span class="original money"&gt;{{ product.selected_or_first_available_variant.compare_at_price | money }}&lt;/span&gt; &lt;span class="money mets" itemprop="price"&gt;{{ product.selected_or_first_available_variant.price | money }}&lt;/span&gt;&lt;/p&gt;
          {% else %}
            &lt;p class="price"&gt;&lt;span class="money mets" itemprop="price"&gt;{{ product.selected_or_first_available_variant.price | money }}&lt;/span&gt;&lt;/p&gt;
          {% endif %}
      &lt;/div&gt;
  
      &lt;form class="module options quick-shop-form {% unless itemType.available %}unavailable{% endunless %}" action="/cart/add" method="post" id="quick-shop-form-{{ itemType.id }}" data-product-id="{{ itemType.id }}"&gt;
  &lt;h3 style="text-transform: uppercase; padding-bottom: 10px;"&gt;Order by the metre&lt;/h3&gt;
        {% if itemType.available %} &lt;!-- If the product is available then... --&gt;
  
          &lt;input type="hidden" name="id" class="product-select" value="{{ firstVariant.id }}" data-variant-title="{{ firstVariant.title }}" /&gt;
  
          &lt;div class="selector-wrapper quantity" style="margin-bottom: 0;"&gt;
                &lt;p&gt;Quantity &amp;nbsp;&lt;select id="quantity" class="drops" name="quantity"&gt;
  {% for i in (2..30) %}
  &lt;option value="{{ i }}"&gt;{{ i }}&lt;/option&gt;
  {% endfor %}
  &lt;/select&gt; metres&lt;/p&gt;
                &lt;p&gt;&lt;em&gt;Minimum 2 metres. Whole metres only&lt;/em&gt;&lt;/p&gt;
              &lt;/div&gt;
  
          &lt;div class="selector-wrapper"&gt;
            {% if itemType.options.size &gt; 1 %}&lt;label&gt;&lt;/label&gt;{% endif %}
            &lt;input class="action-button submit" type="submit" value="{{ 'products.product.add_to_cart' | t }}" style="margin-top: 0;"/&gt;
        &lt;/div&gt;
  
          &lt;div class="error-wrap"&gt;&lt;/div&gt;
  
        {% else %}
  
          &lt;span class="action-button unavailable disabled"&gt;{{ 'products.product.sold_out' | t }}&lt;/span&gt;
  
        {% endif %}
  
      &lt;/form&gt;
  &lt;hr style="width: 50%; margin: 0 25% 20px 25%;" /&gt;
          &lt;h3 style="text-transform: uppercase; padding-bottom: 15px;"&gt;Order a free sample&lt;/h3&gt;
      &lt;form method="post" action="/cart/add"&gt;
      &lt;input type="hidden" name="id" value="{{ product.variants.last.id }}" /&gt;
      &lt;input type="submit" class="action-button" value="{{ 'products.product.add_to_cart' | t }}" /&gt;
    &lt;/form&gt; 
          &lt;p&gt;&lt;em&gt;Max. 5 samples per order&lt;/em&gt;&lt;/p&gt;
      &lt;div class="module description"&gt;
        {% if itemType.description.size &gt; 0 %}
          &lt;div class="rte special"&gt;{{ itemType.description }}&lt;/div&gt;
        {% endif %}
        &lt;a class="go-to-product" href="{{ itemType.url }}"&gt;{{ 'products.product.visit_page' | t }} &lt;span&gt;→&lt;/span&gt;&lt;/a&gt;
      &lt;/div&gt;
  
    &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;script&gt;
    Theme.products["{{ itemType.id }}"] = {{ itemType | json }};
    Theme.products["{{ product.id }}"].firstVariant = {{ product.selected_or_first_available_variant.id | json }};
  &lt;/script&gt;
  </code></pre>
  
  <p>And then here are the javascript sections that relate to this (I think! if I am missing something please do say and I can post it)</p>
  
  <pre><code>ProductView.prototype.events = {
    "click #product-area .thumb": "determineSelectedThumb",
    "click .fullscreen-product-viewer .thumb": "determineSelectedThumb",
    "click .toggle-fullview": "openFullview",
    "click .fullscreen-product-viewer": "closeFullview",
    "click .fullscreen-product-viewer .modal": "stopProp",
    "click #product-area .submit": "addProductToCart",
    "click .modal-wrap .close": "closeFullview",
    "change #product-area .single-option-selector": "resetErrors"
  };
  
  ProductView.prototype.addProductToCart = function(e) {
    var quantity, submitButton, variant;
    if (Theme.productQuickAdd) {
      e.preventDefault();
      submitButton = this.$(e.target);
      if (this.processing === false) {
        submitButton.data("original-text", submitButton.val()).val(Theme.pleaseWait).addClass("disabled");
        this.processing = true;
        variant = this.$(".product-select").val();
        quantity = this.$(".product-quantity").val();
        return Shopify.addItemFromForm('product-form', (function(_this) {
          return function(product) {
            Shopify.getCart(function(cart) {
              return _this.updateMiniCart(cart);
            });
            submitButton.val(Theme.addedToCart);
            return setTimeout(function() {
              submitButton.val(submitButton.data("original-text")).removeClass("disabled");
              return _this.processing = false;
            }, 2000);
          };
        })(this));
      } else {
        return false;
      }
    }
  };
  
  ProductView.prototype.updateMiniCart = function(cart) {
    var i, item, itemProperties, itemText, j, len, miniCartItemsWrap, productPrice, propertiesArray, propertyKeysArray, ref, variant;
    miniCartItemsWrap = $(".mini-cart-items-wrap");
    miniCartItemsWrap.empty();
    if (cart.items.length !== 1) {
      itemText = Theme.cartItemsOther;
    } else {
      itemText = Theme.cartItemsOne;
      $(".mini-cart .options").show();
      miniCartItemsWrap.find(".no-items").hide();
    }
    $(".mini-cart-wrap label").html("&lt;span class='item-count'&gt;" + cart.items.length + "&lt;/span&gt; " + itemText);
    ref = cart.items;
    for (j = 0, len = ref.length; j &lt; len; j++) {
      item = ref[j];
      productPrice = Shopify.formatMoney(item.line_price, Theme.moneyFormat);
      variant = item.variant_title ? "&lt;p class='variant'&gt;" + item.variant_title + "&lt;/p&gt;" : "";
      itemProperties = "";
      if (item.properties) {
        propertyKeysArray = Object.keys(item.properties);
        propertiesArray = _.values(item.properties);
        i = 0;
        while (i &lt; propertyKeysArray.length) {
          if (propertiesArray[i].length) {
            itemProperties = itemProperties + ("&lt;p class=\"property\"&gt;\n    &lt;span class=\"property-label\"&gt;" + propertyKeysArray[i] + ":&lt;/span&gt;\n    &lt;span class=\"property-value\"&gt;" + propertiesArray[i] + "&lt;/span&gt;\n&lt;/p&gt;");
          }
          i++;
        }
      }
      miniCartItemsWrap.append("&lt;div id=\"item-" + item.variant_id + "\" class=\"item clearfix\"&gt;\n    &lt;div class=\"image-wrap\"&gt;\n        &lt;img alt=\"" + item.title + "\" src=\"" + item.image + "\"&gt;\n        &lt;a class=\"overlay\" href=\"" + item.url + "\"&gt;&lt;/a&gt;\n    &lt;/div&gt;\n    &lt;div class=\"details\"&gt;\n        &lt;p class=\"brand\"&gt;" + item.vendor + "&lt;/p&gt;\n        &lt;p class=\"title\"&gt;&lt;a href=\"" + item.url + "\"&gt;" + item.product_title + "&lt;/a&gt;&lt;span class=\"quantity\"&gt;× &lt;span class=\"count\"&gt;" + item.quantity + "&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;\n        &lt;p class=\"price\"&gt;&lt;span class=\"money\"&gt;" + productPrice + "&lt;/span&gt;&lt;/p&gt;\n        " + variant + "\n        " + itemProperties + "\n    &lt;/div&gt;\n&lt;/div&gt;");
    }
    if (Theme.currencySwitcher) {
      return $(document.body).trigger("switch-currency");
    }
  };
  
  QuickShopView.prototype.updateMiniCart = function(cart, properties) {
    var i, item, itemProperties, itemText, j, len, miniCartItemsWrap, productPrice, propertiesArray, propertyKeysArray, ref, variant;
    miniCartItemsWrap = $(".mini-cart-items-wrap");
    miniCartItemsWrap.empty();
    if (cart.items.length !== 1) {
      itemText = Theme.cartItemsOther;
    } else {
      itemText = Theme.cartItemsOne;
      $(".mini-cart .options").show();
      miniCartItemsWrap.find(".no-items").hide();
    }
    $(".mini-cart-wrap label").html("&lt;span class='items-count'&gt;" + cart.items.length + "&lt;/span&gt; " + itemText);
    ref = cart.items;
    for (j = 0, len = ref.length; j &lt; len; j++) {
      item = ref[j];
      productPrice = Shopify.formatMoney(item.line_price, Theme.moneyFormat);
      variant = item.variant_title ? "&lt;p class='variant'&gt;" + item.variant_title + "&lt;/p&gt;" : "";
      itemProperties = "";
      if (item.properties) {
        propertyKeysArray = Object.keys(item.properties);
        propertiesArray = _.values(item.properties);
        i = 0;
        while (i &lt; propertyKeysArray.length) {
          if (propertiesArray[i].length) {
            itemProperties = itemProperties + ("&lt;p class=\"property\"&gt;\n    &lt;span class=\"property-label\"&gt;" + propertyKeysArray[i] + ":&lt;/span&gt;\n    &lt;span class=\"property-value\"&gt;" + propertiesArray[i] + "&lt;/span&gt;\n&lt;/p&gt;");
          }
          i++;
        }
      }
      miniCartItemsWrap.append("&lt;div id=\"item-" + item.variant_id + "\" class=\"item clearfix\"&gt;\n    &lt;div class=\"image-wrap\"&gt;\n        &lt;img alt=\"" + item.title + "\" src=\"" + item.image + "\"&gt;\n        &lt;a class=\"overlay\" href=\"" + item.url + "\"&gt;&lt;/a&gt;\n    &lt;/div&gt;\n    &lt;div class=\"details\"&gt;\n        &lt;p class=\"brand\"&gt;" + item.vendor + "&lt;/p&gt;\n        &lt;p class=\"title\"&gt;&lt;a href=\"" + item.url + "\"&gt;" + item.product_title + "&lt;/a&gt;&lt;span class=\"quantity\"&gt;× &lt;span class=\"count\"&gt;" + item.quantity + "&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;\n        &lt;p class=\"price\"&gt;&lt;span class=\"money\"&gt;" + productPrice + "&lt;/span&gt;&lt;/p&gt;\n        " + variant + "\n        " + itemProperties + "\n    &lt;/div&gt;\n&lt;/div&gt;");
    }
    if (Theme.currencySwitcher) {
      return $(document.body).trigger("switch-currency");
    }
  };
  
  QuickShopView.prototype.addToCart = function(e) {
    var button, imageAlt, j, k, len, len1, postToCartUrl, productFormID, properties, ref, selector, thumb, variantSelectors, variantTitle;
    if (Theme.productQuickAdd) {
      e.preventDefault();
      variantTitle = '';
      variantSelectors = this.quickShop.find('.single-option-selector');
      for (j = 0, len = variantSelectors.length; j &lt; len; j++) {
        selector = variantSelectors[j];
        selector = $(selector);
        variantTitle += selector.val() + " / ";
      }
      variantTitle = variantTitle.substring(0, variantTitle.length - 3);
      properties = {};
      properties.variant = {};
      properties.product = {};
      properties.quantity = {};
      properties.matching_image = {};
      properties.quantity.added = this.quickShop.find('.product-quantity').val();
      properties.variant.id = this.quickShop.find('.product-select').val();
      properties.variant.title = this.quickShop.find('.product-select').data('variant-title') || variantTitle;
      properties.product.title = this.quickShop.find('.title').text();
      properties.product.url = this.quickShop.find('.title a').attr('href');
      ref = this.quickShop.find('.thumb');
      for (k = 0, len1 = ref.length; k &lt; len1; k++) {
        thumb = ref[k];
        imageAlt = $(thumb).find('img').attr('alt');
        if (variantTitle.indexOf(imageAlt) &gt; -1) {
          properties.matching_image = $(thumb).find('img').attr('src');
        }
      }
      postToCartUrl = "/cart/add.js?quantity=" +     properties.quantity.added + "&amp;id=" + properties.variant.id;
      productFormID = this.quickShop.find('.quick-shop-form').attr('id');
      button = this.quickShop.find('.submit');
      button.data('original-text', button.val());
      button.val(Theme.pleaseWait).addClass('disabled');
      return Shopify.addItemFromForm(productFormID, (function(_this) {
        return function(product) {
          button.val(Theme.addedToCart);
          _this.errorWrap.html('');
          return Shopify.getCart(function(cart) {
            return _this.updateMiniCart(cart, properties);
          });
        };
      })(this));
    }
  };
  </code></pre>
  
  <p>If you need any extra information or coding please say - many thanks for any help</p>