Skip to content

Commit c3059d6

Browse files
authored
MAGETWO-65261: [GitHub][PR] Fix swatch-renderer.js product id and isProductViewExist #8484
2 parents 04fa524 + 805c498 commit c3059d6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,16 +344,14 @@ define([
344344
_determineProductData: function () {
345345
// Check if product is in a list of products.
346346
var productId,
347-
product,
348347
isInProductView = false;
349348

350349
productId = this.element.parents('.product-item-details')
351350
.find('.price-box.price-final_price').attr('data-product-id');
352351

353352
if (!productId) {
354353
// Check individual product.
355-
product = document.getElementsByName('product')[0];
356-
productId = product ? product.value : undefined;
354+
productId = $('[name=product]').val();
357355
isInProductView = productId > 0;
358356
}
359357

0 commit comments

Comments
 (0)