File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 6
6
namespace Magento \Catalog \Pricing \Price ;
7
7
8
8
use Magento \Catalog \Model \Product \Option \Value ;
9
+ use Magento \Catalog \Model \Product \Option ;
9
10
use Magento \Catalog \Pricing \Price ;
10
11
use Magento \Framework \Pricing \Price \AbstractPrice ;
11
12
@@ -61,7 +62,10 @@ public function getValue()
61
62
} elseif ($ price < $ min ) {
62
63
$ min = $ price ;
63
64
}
64
- if ($ price > $ max ) {
65
+ $ type = $ optionItem ->getType ();
66
+ if ($ type == Option::OPTION_TYPE_CHECKBOX || $ type == Option::OPTION_TYPE_MULTIPLE ) {
67
+ $ max += $ price ;
68
+ } elseif ($ price > $ max ) {
65
69
$ max = $ price ;
66
70
}
67
71
}
Original file line number Diff line number Diff line change 6
6
namespace Magento \Catalog \Test \Unit \Pricing \Price ;
7
7
8
8
use \Magento \Catalog \Pricing \Price \CustomOptionPrice ;
9
+ use Magento \Catalog \Model \Product \Option ;
9
10
10
11
use Magento \Framework \Pricing \PriceInfoInterface ;
11
12
use Magento \Catalog \Model \Product \Option \Value ;
@@ -177,7 +178,7 @@ public function testGetValue()
177
178
$ option2Id = 2 ;
178
179
$ option2MaxPrice = 200 ;
179
180
$ option2MinPrice = 20 ;
180
- $ option2Type = ' choice ' ;
181
+ $ option2Type = Option:: OPTION_TYPE_CHECKBOX ;
181
182
182
183
$ optionsData = [
183
184
[
@@ -229,7 +230,7 @@ public function testGetValue()
229
230
'option_id ' => $ option2Id ,
230
231
'type ' => $ option2Type ,
231
232
'min ' => 0. ,
232
- 'max ' => $ option2MaxPrice ,
233
+ 'max ' => $ option2MaxPrice + $ option2MinPrice ,
233
234
],
234
235
[
235
236
'option_id ' => $ singleValueOptionId ,
You can’t perform that action at this time.
0 commit comments