File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
app/code/Magento/Swatches/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -331,23 +331,29 @@ define([
331
331
/**
332
332
* Determine product id and related data
333
333
*
334
- * @returns {{productId: *, isInProductView: boolean } }
334
+ * @returns {{productId: *, isInProductView: bool } }
335
335
* @private
336
336
*/
337
- _determineProductData : function ( ) {
337
+ _determineProductData : function ( ) {
338
338
// Check if product is in a list of products.
339
- var productId = this . element . parents ( '.product-item-details' )
340
- . find ( '.price-box.price-final_price' ) . attr ( 'data- product-id' ) ,
339
+ var productId ,
340
+ product ,
341
341
isInProductView = false ;
342
342
343
+ productId = this . element . parents ( '.product-item-details' )
344
+ . find ( '.price-box.price-final_price' ) . attr ( 'data-product-id' ) ;
345
+
343
346
if ( ! productId ) {
344
347
// Check individual product.
345
- var product = document . getElementsByName ( 'product' ) [ 0 ] ;
348
+ product = document . getElementsByName ( 'product' ) [ 0 ] ;
346
349
productId = product ? product . value : undefined ;
347
350
isInProductView = productId > 0 ;
348
351
}
349
352
350
- return { productId : productId , isInProductView : isInProductView } ;
353
+ return {
354
+ productId : productId ,
355
+ isInProductView : isInProductView
356
+ } ;
351
357
} ,
352
358
353
359
/**
You can’t perform that action at this time.
0 commit comments