diff --git a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js index 72bc6ab6f75b3..f1d18cd719a41 100644 --- a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js @@ -337,7 +337,6 @@ define([ _determineProductData: function () { // Check if product is in a list of products. var productId, - product, isInProductView = false; productId = this.element.parents('.product-item-details') @@ -345,8 +344,7 @@ define([ if (!productId) { // Check individual product. - product = document.getElementsByName('product')[0]; - productId = product ? product.value : undefined; + productId = $('[name=product]').val(); isInProductView = productId > 0; }