@@ -145,20 +145,20 @@ define([
145
145
this . customerSelectorHide ( ) ;
146
146
if ( this . storeId ) {
147
147
$ ( this . getAreaId ( 'data' ) ) . callback = 'dataLoaded' ;
148
- $ ( this . getAreaId ( 'form' ) ) . callback = 'dataLoaded' ;
149
- this . loadArea ( [ 'data' , 'form' ] , true ) ;
148
+ this . loadArea ( [ 'data' ] , true ) ;
150
149
} else {
151
150
this . storeSelectorShow ( ) ;
152
151
}
153
152
} ,
154
153
155
- setStoreId : function ( id ) {
154
+ setStoreId : function ( id ) {
156
155
this . storeId = id ;
157
156
this . storeSelectorHide ( ) ;
158
157
this . sidebarShow ( ) ;
159
- this . loadArea ( [ 'header' , 'sidebar' , 'data' ] , true ) ;
158
+ // this.loadArea(['header', 'sidebar','data'], true);
160
159
this . dataShow ( ) ;
161
- /// this.loadArea(['header', 'data', 'form'], true);
160
+ this . loadArea ( [ 'header' , 'data' ] , true ) ;
161
+ location . reload ( true ) ;
162
162
} ,
163
163
164
164
setCurrencyId : function ( id ) {
@@ -507,7 +507,7 @@ define([
507
507
this . loadArea ( [ 'card_validation' ] , true , data ) ;
508
508
} ,
509
509
510
- setPaymentMethod : function ( method ) {
510
+ setPaymentMethod : function ( method ) {
511
511
if ( this . paymentMethod && $ ( 'payment_form_' + this . paymentMethod ) ) {
512
512
var form = 'payment_form_' + this . paymentMethod ;
513
513
[ form + '_before' , form , form + '_after' ] . each ( function ( el ) {
@@ -1164,7 +1164,42 @@ define([
1164
1164
}
1165
1165
} ,
1166
1166
1167
-
1167
+ loadArea : function ( area , indicator , params ) {
1168
+ var deferred = new jQuery . Deferred ( ) ;
1169
+ var url = this . loadBaseUrl ;
1170
+ if ( area ) {
1171
+ area = this . prepareArea ( area ) ;
1172
+ url += 'block/' + area ;
1173
+ }
1174
+ if ( indicator === true ) indicator = 'html-body' ;
1175
+ params = this . prepareParams ( params ) ;
1176
+ params . json = true ;
1177
+ if ( ! this . loadingAreas ) this . loadingAreas = [ ] ;
1178
+ if ( indicator ) {
1179
+ this . loadingAreas = area ;
1180
+ new Ajax . Request ( url , {
1181
+ parameters : params ,
1182
+ loaderArea : indicator ,
1183
+ onSuccess : function ( transport ) {
1184
+ var response = transport . responseText . evalJSON ( ) ;
1185
+ this . loadAreaResponseHandler ( response ) ;
1186
+ deferred . resolve ( ) ;
1187
+ } . bind ( this )
1188
+ } ) ;
1189
+ } else {
1190
+ new Ajax . Request ( url , {
1191
+ parameters : params ,
1192
+ loaderArea : indicator ,
1193
+ onSuccess : function ( transport ) {
1194
+ deferred . resolve ( ) ;
1195
+ }
1196
+ } ) ;
1197
+ }
1198
+ if ( typeof productConfigure != 'undefined' && area instanceof Array && area . indexOf ( 'items' ) != - 1 ) {
1199
+ productConfigure . clean ( 'quote_items' ) ;
1200
+ }
1201
+ return deferred . promise ( ) ;
1202
+ } ,
1168
1203
1169
1204
loadAreaResponseHandler : function ( response ) {
1170
1205
if ( response . error ) {
@@ -1238,7 +1273,7 @@ define([
1238
1273
return 'order-' + area ;
1239
1274
} ,
1240
1275
1241
- prepareParams : function ( params ) {
1276
+ prepareParams : function ( params ) {
1242
1277
if ( ! params ) {
1243
1278
params = { } ;
1244
1279
}
0 commit comments