diff --git a/assets/product-form.js b/assets/product-form.js index 974920ad890..6eec3bc2313 100644 --- a/assets/product-form.js +++ b/assets/product-form.js @@ -26,7 +26,7 @@ if (!customElements.get('product-form')) { delete config.headers['Content-Type']; const formData = new FormData(this.form); - if (this.dataset.cartType != 'page') { + if (this.cart) { formData.append('sections', this.cart.getSectionsToRender().map((section) => section.id)); formData.append('sections_url', window.location.pathname); this.cart.setActiveElement(document.activeElement); @@ -46,7 +46,7 @@ if (!customElements.get('product-form')) { soldOutMessage.classList.remove('hidden'); this.error = true; return; - } else if (this.dataset.cartType == 'page') { + } else if (!this.cart) { window.location = window.routes.cart_url; return; } diff --git a/sections/featured-product.liquid b/sections/featured-product.liquid index c5e12f21349..e5aba9c027f 100644 --- a/sections/featured-product.liquid +++ b/sections/featured-product.liquid @@ -257,7 +257,7 @@ {%- when 'buy_buttons' -%}