Skip to content

Commit

Permalink
fixed issue #24410
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosh committed Sep 7, 2019
1 parent 54244f7 commit 114ac4b
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions app/code/Magento/Catalog/Model/Product/TierPriceManagement.php
Expand Up @@ -182,16 +182,19 @@ public function getList($sku, $customerGroupId)
: $customerGroupId);

$prices = [];
foreach ($product->getData('tier_price') as $price) {
if ((is_numeric($customerGroupId) && (int) $price['cust_group'] === (int) $customerGroupId)
|| ($customerGroupId === 'all' && $price['all_groups'])
) {
/** @var \Magento\Catalog\Api\Data\ProductTierPriceInterface $tierPrice */
$tierPrice = $this->priceFactory->create();
$tierPrice->setValue($price[$priceKey])
->setQty($price['price_qty'])
->setCustomerGroupId($cgi);
$prices[] = $tierPrice;
$tierPrices = $product->getData('tier_price');
if ($tierPrices !== null) {
foreach ($tierPrices as $price) {
if ((is_numeric($customerGroupId) && (int) $price['cust_group'] === (int) $customerGroupId)
|| ($customerGroupId === 'all' && $price['all_groups'])
) {
/** @var \Magento\Catalog\Api\Data\ProductTierPriceInterface $tierPrice */
$tierPrice = $this->priceFactory->create();
$tierPrice->setValue($price[$priceKey])
->setQty($price['price_qty'])
->setCustomerGroupId($cgi);
$prices[] = $tierPrice;
}
}
}
return $prices;
Expand Down

0 comments on commit 114ac4b

Please sign in to comment.