mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-03 16:09:36 +00:00
Use better fields for determine the product name
This commit is contained in:
parent
f168b2a83c
commit
2f8553303d
1 changed files with 6 additions and 6 deletions
|
|
@ -112,8 +112,8 @@ readonly class ConradProvider implements InfoProviderInterface
|
||||||
$out[] = new SearchResultDTO(
|
$out[] = new SearchResultDTO(
|
||||||
provider_key: $this->getProviderKey(),
|
provider_key: $this->getProviderKey(),
|
||||||
provider_id: $result['productId'],
|
provider_id: $result['productId'],
|
||||||
name: $result['title'],
|
name: $result['manufacturerId'] ?? $result['productId'],
|
||||||
description: '',
|
description: $result['title'] ?? '',
|
||||||
manufacturer: $result['brand']['name'] ?? null,
|
manufacturer: $result['brand']['name'] ?? null,
|
||||||
mpn: $result['manufacturerId'] ?? null,
|
mpn: $result['manufacturerId'] ?? null,
|
||||||
preview_image_url: $result['image'] ?? null,
|
preview_image_url: $result['image'] ?? null,
|
||||||
|
|
@ -247,7 +247,7 @@ readonly class ConradProvider implements InfoProviderInterface
|
||||||
$minOrderAmount = $result['priceAndAvailabilityFacadeResponse']['priceAndAvailability']['availabilityStatus']['minimumOrderQuantity'] ?? 1;
|
$minOrderAmount = $result['priceAndAvailabilityFacadeResponse']['priceAndAvailability']['availabilityStatus']['minimumOrderQuantity'] ?? 1;
|
||||||
|
|
||||||
$prices = [];
|
$prices = [];
|
||||||
foreach ($priceInfo['priceScale'] as $priceScale) {
|
foreach ($priceInfo['priceScale'] ?? [] as $priceScale) {
|
||||||
$prices[] = new PriceDTO(
|
$prices[] = new PriceDTO(
|
||||||
minimum_discount_amount: max($priceScale['scaleFrom'], $minOrderAmount),
|
minimum_discount_amount: max($priceScale['scaleFrom'], $minOrderAmount),
|
||||||
price: (string)$priceScale['pricePerUnit'],
|
price: (string)$priceScale['pricePerUnit'],
|
||||||
|
|
@ -288,9 +288,9 @@ readonly class ConradProvider implements InfoProviderInterface
|
||||||
return new PartDetailDTO(
|
return new PartDetailDTO(
|
||||||
provider_key: $this->getProviderKey(),
|
provider_key: $this->getProviderKey(),
|
||||||
provider_id: $data['shortProductNumber'],
|
provider_id: $data['shortProductNumber'],
|
||||||
name: $data['productShortInformation']['title'],
|
name: $data['productFullInformation']['manufacturer']['name'] ?? $data['productFullInformation']['manufacturer']['id'] ?? $data['shortProductNumber'],
|
||||||
description: $data['productShortInformation']['shortDescription'] ?? '',
|
description: $data['productShortInformation']['title'] ?? '',
|
||||||
manufacturer: $data['brand']['displayName'] ?? null,
|
manufacturer: $data['brand']['displayName'] !== null ? preg_replace("/[\u{2122}\u{00ae}]/", "", $data['brand']['displayName']) : null, //Replace ™ and ® symbols
|
||||||
mpn: $data['productFullInformation']['manufacturer']['id'] ?? null,
|
mpn: $data['productFullInformation']['manufacturer']['id'] ?? null,
|
||||||
preview_image_url: $data['productShortInformation']['mainImage']['imageUrl'] ?? null,
|
preview_image_url: $data['productShortInformation']['mainImage']['imageUrl'] ?? null,
|
||||||
provider_url: $this->getProductUrl($data['shortProductNumber']),
|
provider_url: $this->getProductUrl($data['shortProductNumber']),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue