mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-12 04:29:36 +00:00
Allow to extract prices form an Amazon page
This commit is contained in:
parent
b89e878871
commit
73dbe64a83
1 changed files with 10 additions and 0 deletions
|
|
@ -196,6 +196,16 @@ class GenericWebProvider implements InfoProviderInterface
|
||||||
price: $price,
|
price: $price,
|
||||||
currency_iso_code: $this->getMetaContent($dom, 'product:price:currency'),
|
currency_iso_code: $this->getMetaContent($dom, 'product:price:currency'),
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
//Amazon fallback
|
||||||
|
$amazonAmount = $dom->filter('input[type="hidden"][name*="amount"]');
|
||||||
|
if ($amazonAmount->count() > 0) {
|
||||||
|
$prices[] = new PriceDTO(
|
||||||
|
minimum_discount_amount: 1,
|
||||||
|
price: $amazonAmount->first()->attr('value'),
|
||||||
|
currency_iso_code: $dom->filter('input[type="hidden"][name*="currencyCode"]')->first()->attr('value'),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$vendor_infos = [new PurchaseInfoDTO(
|
$vendor_infos = [new PurchaseInfoDTO(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue