My Cart: 0 item(s)

Product Search

Secure Checkout
Wholesale Hero Banner

Sell Nature's Fusions Essential Oils and Hemp Extract Products

Have interest in selling our products?

Fill out the form below and one of our sales reps will reach out to you.

Contact naturesfusions.com Form

Personal

Contact

Shipping

Additional




function addTest(window, document, undefined) { const i = document.querySelectorAll('form[name="add"]').length + 1 'use strict'; var purchaseButton = document.querySelector('[data-hook="add-to-cart' + i + '"]'); var purchaseButtonText = (purchaseButton.nodeName.toLowerCase() === 'input') ? purchaseButton.value : purchaseButton.textContent; var purchaseForm = document.querySelector('[data-hook="purchase' + i + '"]'); var purchaseFormActionInput = purchaseForm.querySelector('input[name="Action"]'); var responseMessage = document.querySelector('[data-hook="purchase-message' + i + '"]' ); var miniBasketCount = document.querySelectorAll('[data-hook~="mini-basket-count"]'); var miniBasketAmount = document.querySelectorAll('[data-hook~="mini-basket-amount"]'); purchaseButton.addEventListener('click', function (evt) { evt.preventDefault(); evt.stopImmediatePropagation(); purchaseForm.action = purchaseButton.getAttribute('data-action'); purchaseFormActionInput.value = 'ADPR'; var data = new FormData(purchaseForm); var request = new XMLHttpRequest(); // Set up our HTTP request purchaseForm.setAttribute('data-status', 'idle'); if (purchaseForm.getAttribute('data-status') !== 'submitting') { purchaseForm.setAttribute('data-status', 'submitting'); purchaseButton.setAttribute('disabled', 'disabled'); if (purchaseButton.nodeName.toLowerCase() === 'input') { purchaseButton.value = 'Processing...'; } else{ purchaseButton.textContent = 'Processing...'; } responseMessage.innerHTML = ''; // Setup our listener to process completed requests request.onreadystatechange = function () { // Only run if the request is complete if (request.readyState !== 4) { return; } // Process our return data if (request.status === 200) { // What do when the request is successful var response = request.response; if (response.body.id === 'js-BASK') { var basketData = response.querySelector('[data-hook="basket"]'); var basketCount = basketData.getAttribute('data-item-count'); var basketSubtotal = basketData.getAttribute('data-subtotal'); if (miniBasketCount) { for (var mbcID = 0; mbcID < miniBasketCount.length; mbcID++) { miniBasketCount[mbcID].textContent = basketCount; // Update mini-basket quantity (display only) } } if (miniBasketAmount) { for (var mbaID = 0; mbaID < miniBasketAmount.length; mbaID++) { miniBasketAmount[mbaID].textContent = basketSubtotal; // Update mini-basket subtotal (display only) } } if (typeof miniBasket !== 'undefined') { document.querySelector('[data-hook="mini-basket"]').innerHTML = response.querySelector('[data-hook="mini-basket"]').innerHTML; setTimeout(function () { document.querySelector('[data-hook="open-mini-basket"]').click(); }, 100); } else { responseMessage.innerHTML = '
Added to cart.
'; } // Re-Initialize Attribute Machine (if it is active) if (typeof attrMachCall !== 'undefined') { attrMachCall.Initialize(); } } else if(response.body.id === 'js-PATR') { var findRequired = purchaseForm.querySelectorAll('.is-required'); var missingAttributes = []; for (var id = 0; id < findRequired.length; id++) { missingAttributes.push(' ' + findRequired[id].title); } responseMessage.innerHTML = '
All Required options have not been selected.
Please review the following options: ' + missingAttributes + '.
'; } else if(response.body.id === 'js-PLMT') { responseMessage.innerHTML = '
We do not have enough of the combination you have selected.
Please adjust your quantity.
'; } else if(response.body.id === 'js-POUT') { responseMessage.innerHTML = '
The combination you have selected is out of stock.
Please review your options or check back later.
'; } else { responseMessage.innerHTML = '
Please review your selection.
'; } // Reset button text and form status purchaseButton.removeAttribute('disabled'); if (purchaseButton.nodeName.toLowerCase() === 'input') { purchaseButton.value = purchaseButtonText; } else{ purchaseButton.textContent = purchaseButtonText; } purchaseForm.setAttribute('data-status', 'idle'); } else { // What do when the request fails console.log('The request failed!'); purchaseForm.setAttribute('data-status', 'idle'); } }; /** * Create and send a request * The first argument is the post type (GET, POST, PUT, DELETE, etc.) * The second argument is the endpoint URL */ request.open(purchaseForm.method, purchaseForm.action); request.responseType = 'document'; request.send(data); } }, false); }(window, document);