This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend Expand file tree Collapse file tree 2 files changed +25
-2
lines changed 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,8 @@ 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 ->expects ($ this ->exactly ( 2 ))->method ('getAllCustomersGroup ' )->willReturn ($ allCustomersGroup );
184
+ $ allCustomersGroup ->expects ($ this ->exactly ( 2 ))->method ('getId ' )->willReturn ($ allCustomersGroupId );
175
185
$ object ->expects ($ this ->once ())->method ('getPrice ' )->willReturn ($ productPrice );
176
186
$ this ->attribute ->expects ($ this ->atLeastOnce ())->method ('isScopeGlobal ' )->willReturn (true );
177
187
$ object ->expects ($ this ->once ())->method ('getStoreId ' )->willReturn (null );
Original file line number Diff line number Diff line change
1
+ diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php
2
+ index f7ab3f5..cd686c0 100644
3
+ --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php
4
+ +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php
5
+ @@ -360,7 +360,7 @@ abstract class AbstractGroupPrice extends Price
6
+ {
7
+ /** @var array $priceItem */
8
+ foreach ($data as $key => $priceItem) {
9
+ - if (isset($priceItem['price']) && $priceItem['price'] > 0) {
10
+ + if (array_key_exists('price', $priceItem)) {
11
+ $data[$key]['website_price'] = $priceItem['price'];
12
+ }
13
+ if ($priceItem['all_groups']) {
You can’t perform that action at this time.
0 commit comments