File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Model/Product/Attribute/Backend/GroupPrice
Test/Unit/Model/Product/Attribute/Backend Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -358,7 +358,7 @@ protected function modifyPriceData($object, $data)
358
358
{
359
359
/** @var array $priceItem */
360
360
foreach ($ data as $ key => $ priceItem ) {
361
- if (isset ( $ priceItem [ 'price ' ]) && $ priceItem[ ' price ' ] > 0 ) {
361
+ if (array_key_exists ( 'price ' , $ priceItem) ) {
362
362
$ data [$ key ]['website_price ' ] = $ priceItem ['price ' ];
363
363
}
364
364
if ($ priceItem ['all_groups ' ]) {
Original file line number Diff line number Diff line change @@ -141,6 +141,10 @@ public function testSetPriceData()
141
141
{
142
142
$ attributeName = 'tier_price ' ;
143
143
$ tierPrices = [
144
+ [
145
+ 'price ' => 0 ,
146
+ 'all_groups ' => 1 ,
147
+ ],
144
148
[
145
149
'price ' => 10 ,
146
150
'all_groups ' => 1 ,
@@ -153,6 +157,12 @@ public function testSetPriceData()
153
157
$ productPrice = 20 ;
154
158
$ allCustomersGroupId = 32000 ;
155
159
$ finalTierPrices = [
160
+ [
161
+ 'price ' => 0 ,
162
+ 'all_groups ' => 1 ,
163
+ 'website_price ' => 0 ,
164
+ 'cust_group ' => 32000 ,
165
+ ],
156
166
[
157
167
'price ' => 10 ,
158
168
'all_groups ' => 1 ,
@@ -170,8 +180,11 @@ public function testSetPriceData()
170
180
->disableOriginalConstructor ()->getMock ();
171
181
$ allCustomersGroup = $ this ->getMockBuilder (\Magento \Customer \Api \Data \GroupInterface::class)
172
182
->disableOriginalConstructor ()->getMock ();
173
- $ this ->groupManagement ->expects ($ this ->once ())->method ('getAllCustomersGroup ' )->willReturn ($ allCustomersGroup );
174
- $ allCustomersGroup ->expects ($ this ->once ())->method ('getId ' )->willReturn ($ allCustomersGroupId );
183
+ $ this ->groupManagement
184
+ ->expects ($ this ->exactly (2 ))
185
+ ->method ('getAllCustomersGroup ' )
186
+ ->willReturn ($ allCustomersGroup );
187
+ $ allCustomersGroup ->expects ($ this ->exactly (2 ))->method ('getId ' )->willReturn ($ allCustomersGroupId );
175
188
$ object ->expects ($ this ->once ())->method ('getPrice ' )->willReturn ($ productPrice );
176
189
$ this ->attribute ->expects ($ this ->atLeastOnce ())->method ('isScopeGlobal ' )->willReturn (true );
177
190
$ object ->expects ($ this ->once ())->method ('getStoreId ' )->willReturn (null );
You can’t perform that action at this time.
0 commit comments