Skip to content

Commit c51e0eb

Browse files
committed
Allow to get prices in non-EUR currencies from reichelt
1 parent d05c057 commit c51e0eb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,14 @@ PROVIDER_OEMSECRETS_SORT_CRITERIA=C
223223

224224
# We dont require an API key for Reichelt, just set this to 1 to enable Reichelt support
225225
PROVIDER_REICHELT_ENABLED=0
226-
# The country to get prices for (only EUR supported for now)
226+
# The country to get prices for
227227
PROVIDER_REICHELT_COUNTRY=DE
228228
# The language to get results in (en, de, fr, nl, pl, it, es)
229229
PROVIDER_REICHELT_LANGUAGE=en
230230
# Include VAT in prices (set to 1 to include VAT, 0 to exclude VAT)
231231
PROVIDER_REICHELT_INCLUDE_VAT=1
232+
# The currency to get prices in (only for countries with countries other than EUR)
233+
PROVIDER_REICHELT_CURRENCY=EUR
232234

233235
##################################################################################
234236
# EDA integration related settings

src/Services/InfoProviderSystem/Providers/ReicheltProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public function __construct(private readonly HttpClientInterface $client,
4848
#[Autowire(env: "PROVIDER_REICHELT_COUNTRY")]
4949
private readonly string $country = "DE",
5050
#[Autowire(env: "PROVIDER_REICHELT_INCLUDE_VAT")]
51-
private bool $includeVAT = false
51+
private readonly bool $includeVAT = false,
52+
#[Autowire(env: "PROVIDER_REICHELT_CURRENCY")]
53+
private readonly string $currency = "EUR",
5254
)
5355
{
5456
}
@@ -134,6 +136,7 @@ public function getDetails(string $id): PartDetailDTO
134136
$response = $this->client->request('GET', $productPage, [
135137
'query' => [
136138
'CCTYPE' => $this->includeVAT ? 'private' : 'business',
139+
'currency' => $this->currency,
137140
],
138141
]);
139142
$html = $response->getContent();

0 commit comments

Comments
 (0)