File tree Expand file tree Collapse file tree 3 files changed +16
-14
lines changed Expand file tree Collapse file tree 3 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ define([
17
17
qtyFieldSelector : 'input.qty' ,
18
18
priceBoxSelector : '.price-box' ,
19
19
optionHandlers : { } ,
20
- optionTemplate : '<%- label %>' +
21
- '<% if (finalPrice.value) { %>' +
22
- ' +<%- finalPrice.formatted %>' +
20
+ optionTemplate : '<%- data. label %>' +
21
+ '<% if (data. finalPrice.value) { %>' +
22
+ ' +<%- data. finalPrice.formatted %>' +
23
23
'<% } %>' ,
24
24
controlContainer : 'dd' , // should be eliminated
25
25
priceFormat : { } ,
@@ -163,7 +163,9 @@ define([
163
163
}
164
164
165
165
toTemplate = {
166
- label : optionConfig [ optionValue ] && optionConfig [ optionValue ] . name
166
+ data : {
167
+ label : optionConfig [ optionValue ] && optionConfig [ optionValue ] . name
168
+ }
167
169
} ;
168
170
prices = optionConfig [ optionValue ] . prices ;
169
171
@@ -172,7 +174,7 @@ define([
172
174
value += _ . reduce ( price . adjustments , function ( sum , x ) {
173
175
return sum + x ;
174
176
} , 0 ) ;
175
- toTemplate [ type ] = {
177
+ toTemplate . data [ type ] = {
176
178
value : value ,
177
179
formatted : utils . formatPrice ( value , format )
178
180
} ;
Original file line number Diff line number Diff line change @@ -310,17 +310,17 @@ public function updateProductOptions(\Magento\Framework\Event\Observer $observer
310
310
// prepare correct template for options render
311
311
if ($ this ->_taxData ->displayBothPrices ()) {
312
312
$ options ['optionTemplate ' ] = sprintf (
313
- '<%%= label %%> '
314
- . '<%% if (finalPrice.value) { %%> '
315
- . ' <%%= finalPrice.formatted %%> (%1$s <%%= basePrice.formatted %%>) '
313
+ '<%%= data. label %%> '
314
+ . '<%% if (data. finalPrice.value) { %%> '
315
+ . ' <%%= data. finalPrice.formatted %%> (%1$s <%%= data. basePrice.formatted %%>) '
316
316
. '<%% } %%> ' ,
317
317
__ ('Excl. tax: ' )
318
318
);
319
319
} elseif ($ this ->_taxData ->priceIncludesTax () && $ this ->_taxData ->displayPriceExcludingTax ()) {
320
320
$ options ['optionTemplate ' ] = sprintf (
321
- '<%%= label %%> '
322
- . '<%% if (basePrice.value) { %%> '
323
- . ' <%%= basePrice.formatted %%> '
321
+ '<%%= data. label %%> '
322
+ . '<%% if (data. basePrice.value) { %%> '
323
+ . ' <%%= data. basePrice.formatted %%> '
324
324
. '<%% } %%> '
325
325
);
326
326
}
Original file line number Diff line number Diff line change @@ -90,8 +90,8 @@ public function dataProviderUpdateProductOptions()
90
90
[
91
91
'expected ' => [
92
92
'calculationAlgorithm ' => 'TOTAL_BASE_CALCULATION ' ,
93
- 'optionTemplate ' => '<%= label %><% if (finalPrice.value) ' .
94
- '{ %> <%= finalPrice.formatted %> (Excl. tax: <%= basePrice.formatted %>)<% } %> ' ,
93
+ 'optionTemplate ' => '<%= data. label %><% if (data. finalPrice.value) ' .
94
+ '{ %> <%= data. finalPrice.formatted %> (Excl. tax: <%= data. basePrice.formatted %>)<% } %> ' ,
95
95
],
96
96
'displayBothPrices ' => true ,
97
97
'priceIncludesTax ' => false ,
@@ -100,7 +100,7 @@ public function dataProviderUpdateProductOptions()
100
100
[
101
101
'expected ' => [
102
102
'calculationAlgorithm ' => 'TOTAL_BASE_CALCULATION ' ,
103
- 'optionTemplate ' => '<%= label %><% if (basePrice.value) { %> <%= basePrice.formatted %><% } %> ' ,
103
+ 'optionTemplate ' => '<%= data. label %><% if (data. basePrice.value) { %> <%= data. basePrice.formatted %><% } %> ' ,
104
104
],
105
105
'displayBothPrices ' => false ,
106
106
'priceIncludesTax ' => true ,
You can’t perform that action at this time.
0 commit comments