Skip to content

Commit d075d9b

Browse files
committed
Fix bug where multiple customer prices are not loaded
1 parent f246db4 commit d075d9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Actions/CustomerPrice.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use JustBetter\CustomerPricing\Model\CustomerPricing;
66
use JustBetter\CustomerPricing\Model\ResourceModel\CustomerPricing\Collection;
77
use Psr\Log\LoggerInterface;
8+
use Zend_Db_Select;
89

910
class CustomerPrice
1011
{
@@ -16,8 +17,12 @@ public function __construct(
1617

1718
public function getCustomerPrice(int $productId, int $customerId, int $quantity = 1): ?float
1819
{
19-
$customerPrices = $this->customerPricingCollection
20+
$this->customerPricingCollection
2021
->clear()
22+
->getSelect()
23+
->reset(Zend_Db_Select::WHERE);
24+
25+
$customerPrices = $this->customerPricingCollection
2126
->addFieldToFilter('product_id', ['eq' => $productId])
2227
->addFieldToFilter('customer_id', ['eq' => $customerId])
2328
->load()

0 commit comments

Comments
 (0)