Skip to content

Commit cbb4199

Browse files
committed
[10.x] needs to be implemented loadCurrencyWallets
1 parent 71d7cde commit cbb4199

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Services/EagerLoaderService.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,26 @@ public function __construct(
2121
}
2222

2323
public function loadWalletsByBasket(Customer $customer, BasketDtoInterface $basketDto): void
24+
{
25+
$customerWallet = $this->castService->getWallet($customer);
26+
27+
/** @var string|null $customerCurrency */
28+
$customerCurrency = $customerWallet->meta['currency'] ?? null;
29+
30+
if ($customerCurrency === null) {
31+
$this->loadDefaultWallets($basketDto);
32+
return;
33+
}
34+
35+
$this->loadCurrencyWallets($customerCurrency, $basketDto);
36+
}
37+
38+
private function loadCurrencyWallets(string $currency, BasketDtoInterface $basketDto): void
39+
{
40+
// todo: needs to be implemented
41+
}
42+
43+
private function loadDefaultWallets(BasketDtoInterface $basketDto): void
2444
{
2545
$products = [];
2646
/** @var array<array-key, array<array-key, int|string>> $productGroupIds */

0 commit comments

Comments
 (0)