Skip to content

Commit 84bca45

Browse files
author
Yaroslav Onischenko
committed
MAGETWO-55908: Prepare PR
1 parent 830888c commit 84bca45

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,19 +339,22 @@ public function setPriceData($object, $priceData)
339339
}
340340

341341
/**
342+
* Perform price modification
343+
*
342344
* @param \Magento\Catalog\Model\Product $object
343345
* @param array $data
344346
* @return array
345347
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
346348
*/
347349
protected function modifyPriceData($object, $data)
348350
{
349-
foreach ($data as $k => $v) {
350-
if (isset($v['price']) && $v['price'] > 0) {
351-
$data[$k]['website_price'] = $v['price'];
351+
/** @var array $priceItem */
352+
foreach ($data as $key => $priceItem) {
353+
if (isset($priceItem['price']) && $priceItem['price'] > 0) {
354+
$data[$key]['website_price'] = $priceItem['price'];
352355
}
353-
if ($v['all_groups']) {
354-
$data[$k]['cust_group'] = $this->_groupManagement->getAllCustomersGroup()->getId();
356+
if ($priceItem['all_groups']) {
357+
$data[$key]['cust_group'] = $this->_groupManagement->getAllCustomersGroup()->getId();
355358
}
356359
}
357360
return $data;

app/code/Magento/Catalog/Model/Product/TierPrice.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<?php
22
/**
3-
*
43
* Copyright © 2016 Magento. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76

87
namespace Magento\Catalog\Model\Product;
98

10-
use Magento\Framework\App\ObjectManager;
11-
129
/**
1310
* @codeCoverageIgnore
1411
*/
@@ -83,12 +80,6 @@ public function setCustomerGroupId($customerGroupId)
8380
*/
8481
public function getExtensionAttributes()
8582
{
86-
if (empty($this->_getExtensionAttributes())) {
87-
$this->setExtensionAttributes(
88-
ObjectManager::getInstance()->get(\Magento\Framework\Api\ExtensionAttributesFactory::class)
89-
->create(\Magento\Catalog\Api\Data\ProductTierPriceInterface::class)
90-
);
91-
}
9283
return $this->_getExtensionAttributes();
9384
}
9485

0 commit comments

Comments
 (0)