Skip to content

Commit

Permalink
PriceListTreeHandler TypeErrors fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Hotsaliyk committed Sep 25, 2020
1 parent eee9924 commit 1cda865
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/Oro/Bundle/PricingBundle/Model/PriceListTreeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,18 @@ public function getPriceList(Customer $customer = null, Website $website = null)
}

$priceList = null;
if ($customer) {
$priceList = $this->getPriceListByCustomer($customer, $website);
}
if (!$priceList) {
$priceList = $this->getPriceListByAnonymousCustomerGroup($website);
}
if (!$priceList) {
$priceList = $this->getPriceListRepository()->getPriceListByWebsite($website);
if ($website) {
if ($customer) {
$priceList = $this->getPriceListByCustomer($customer, $website);
}
if (!$priceList) {
$priceList = $this->getPriceListByAnonymousCustomerGroup($website);
}
if (!$priceList) {
$priceList = $this->getPriceListRepository()->getPriceListByWebsite($website);
}
}

if (!$priceList) {
$priceList = $this->getPriceListFromConfig();
}
Expand All @@ -123,8 +126,8 @@ protected function getPriceListByCustomer(Customer $customer, Website $website)
}

/**
* @param Customer|null $customer
* @param Website|null $website
* @param Customer $customer
* @param Website $website
* @return null|CombinedPriceList
*/
protected function getPriceListByCustomerGroup(Customer $customer, Website $website)
Expand All @@ -139,7 +142,7 @@ protected function getPriceListByCustomerGroup(Customer $customer, Website $webs
}

/**
* @param Website|null $website
* @param Website $website
* @return null|CombinedPriceList
*/
protected function getPriceListByAnonymousCustomerGroup(Website $website)
Expand Down

0 comments on commit 1cda865

Please sign in to comment.