@@ -62,6 +62,10 @@ module.exports = baseVw.extend({
6262 reset : true
6363 } ) ;
6464
65+ this . shippingRegions = this . model . get ( 'vendor_offer' ) . listing . shipping . shipping_regions ;
66+ this . shippingOrigin = this . model . get ( 'vendor_offer' ) . listing . shipping . shipping_origin ;
67+ this . worldwide = this . shippingRegions . length === 1 && this . shippingRegions [ 0 ] === 'ALL' ;
68+
6569 this . render ( ) ;
6670 } ,
6771
@@ -91,8 +95,6 @@ module.exports = baseVw.extend({
9195 //el must be passed in from the parent view
9296 loadTemplate ( './js/templates/item.html' , function ( loadedTemplate ) {
9397 loadTemplate ( './js/templates/ratingStars.html' , function ( starsTemplate ) {
94- var shippingRegions = self . model . get ( 'vendor_offer' ) . listing . shipping . shipping_regions ,
95- shippingOrigin = self . model . get ( 'vendor_offer' ) . listing . shipping . shipping_origin ;
9698
9799 self . $el . html (
98100 loadedTemplate (
@@ -103,9 +105,9 @@ module.exports = baseVw.extend({
103105 activeTab : self . activeTab ,
104106 fetchingRatings : self . fetchingRatings ,
105107 userCountry : polyglot . t ( `countries.${ self . userModel . get ( 'country' ) } .name` ) ,
106- shippingRegionsDisplay : localize . localizeShippingRegions ( shippingRegions ) ,
107- worldwide : shippingRegions . length === 1 && shippingRegions [ 0 ] === 'ALL' ,
108- displayShippingOrigin : shippingOrigin && polyglot . t ( `countries.${ shippingOrigin } .name` )
108+ shippingRegionsDisplay : localize . localizeShippingRegions ( self . shippingRegions ) ,
109+ worldwide : self . worldwide ,
110+ displayShippingOrigin : self . shippingOrigin && polyglot . t ( `countries.${ self . shippingOrigin } .name` )
109111 } )
110112 )
111113 ) ;
@@ -176,7 +178,7 @@ module.exports = baseVw.extend({
176178 "use strict" ;
177179 var self = this ;
178180 this . buyWizardView && this . buyWizardView . remove ( ) ;
179- this . buyWizardView = new buyWizardVw ( { model :this . model , userModel : this . options . userModel } ) ;
181+ this . buyWizardView = new buyWizardVw ( { model :this . model , userModel : this . options . userModel , worldwide : this . worldwide , shippingRegions : this . shippingRegions } ) ;
180182 this . registerChild ( this . buyWizardView ) ;
181183 $ ( '#modalHolder' ) . html ( this . buyWizardView . el ) . fadeIn ( 300 ) ; //add to DOM first, or accordion will have zero width when initialized
182184 this . buyWizardView . render ( ) ;
0 commit comments