@@ -299,8 +299,9 @@ define([
299
299
* @param {Event } event
300
300
* @param {mixed } priceIndex
301
301
* @param {Object } prices
302
+ * @param {Object|undefined } $priceBox
302
303
*/
303
- onUpdateMsrpPrice : function onUpdateMsrpPrice ( event , priceIndex , prices ) {
304
+ onUpdateMsrpPrice : function onUpdateMsrpPrice ( event , priceIndex , prices , $priceBox = undefined ) {
304
305
305
306
var defaultMsrp ,
306
307
defaultPrice ,
@@ -322,18 +323,20 @@ define([
322
323
finalPrice = prices [ priceIndex ] . finalPrice . amount ;
323
324
324
325
if ( msrpPrice === null || msrpPrice <= finalPrice ) {
325
- this . updateNonMsrpPrice ( priceUtils . formatPrice ( finalPrice ) ) ;
326
+ this . updateNonMsrpPrice ( priceUtils . formatPrice ( finalPrice ) , $priceBox ) ;
326
327
} else {
327
328
this . updateMsrpPrice (
328
329
priceUtils . formatPrice ( finalPrice ) ,
329
330
priceUtils . formatPrice ( msrpPrice ) ,
330
- false ) ;
331
+ false ,
332
+ $priceBox ) ;
331
333
}
332
334
} else {
333
335
this . updateMsrpPrice (
334
336
priceUtils . formatPrice ( defaultPrice ) ,
335
337
priceUtils . formatPrice ( defaultMsrp ) ,
336
- true ) ;
338
+ true ,
339
+ $priceBox ) ;
337
340
}
338
341
} ,
339
342
@@ -343,41 +346,43 @@ define([
343
346
* @param {String } finalPrice
344
347
* @param {String } msrpPrice
345
348
* @param {Boolean } useDefaultPrice
349
+ * @param {Object|undefined } $priceBox
346
350
*/
347
- updateMsrpPrice : function ( finalPrice , msrpPrice , useDefaultPrice ) {
351
+ updateMsrpPrice : function ( finalPrice , msrpPrice , useDefaultPrice , $priceBox ) {
348
352
var options = this . tierOptions || this . options ;
349
353
350
- $ ( this . options . fallbackPriceContainer ) . hide ( ) ;
351
- $ ( this . options . displayPriceContainer ) . show ( ) ;
352
- $ ( this . options . mapInfoLinks ) . show ( ) ;
354
+ $ ( this . options . fallbackPriceContainer , $priceBox ) . hide ( ) ;
355
+ $ ( this . options . displayPriceContainer , $priceBox ) . show ( ) ;
356
+ $ ( this . options . mapInfoLinks , $priceBox ) . show ( ) ;
353
357
354
358
if ( useDefaultPrice || ! this . wasOpened ) {
355
359
if ( this . $popup ) {
356
360
this . $popup . find ( this . options . msrpLabelId ) . html ( options . msrpPrice ) ;
357
361
this . $popup . find ( this . options . priceLabelId ) . html ( options . realPrice ) ;
358
362
}
359
363
360
- $ ( this . options . displayPriceElement ) . html ( msrpPrice ) ;
364
+ $ ( this . options . displayPriceElement , $priceBox ) . html ( msrpPrice ) ;
361
365
this . wasOpened = true ;
362
366
}
363
367
364
368
if ( ! useDefaultPrice ) {
365
369
this . $popup . find ( this . options . msrpPriceElement ) . html ( msrpPrice ) ;
366
370
this . $popup . find ( this . options . priceElement ) . html ( finalPrice ) ;
367
- $ ( this . options . displayPriceElement ) . html ( msrpPrice ) ;
371
+ $ ( this . options . displayPriceElement , $priceBox ) . html ( msrpPrice ) ;
368
372
}
369
373
} ,
370
374
371
375
/**
372
376
* Display non MAP price for irrelevant products
373
377
*
374
378
* @param {String } price
379
+ * @param {Object|undefined } $priceBox
375
380
*/
376
- updateNonMsrpPrice : function ( price ) {
377
- $ ( this . options . fallbackPriceElement ) . html ( price ) ;
378
- $ ( this . options . displayPriceContainer ) . hide ( ) ;
379
- $ ( this . options . mapInfoLinks ) . hide ( ) ;
380
- $ ( this . options . fallbackPriceContainer ) . show ( ) ;
381
+ updateNonMsrpPrice : function ( price , $priceBox ) {
382
+ $ ( this . options . fallbackPriceElement , $priceBox ) . html ( price ) ;
383
+ $ ( this . options . displayPriceContainer , $priceBox ) . hide ( ) ;
384
+ $ ( this . options . mapInfoLinks , $priceBox ) . hide ( ) ;
385
+ $ ( this . options . fallbackPriceContainer , $priceBox ) . show ( ) ;
381
386
} ,
382
387
383
388
/**
0 commit comments