mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-07 17:04:30 +02:00
Use MPN instead of part name for auto product URLs if available
Implements issue #93
This commit is contained in:
parent
07f95bc6ea
commit
5bf68632c3
1 changed files with 6 additions and 1 deletions
|
@ -75,7 +75,12 @@ trait ManufacturerTrait
|
|||
}
|
||||
|
||||
if (null !== $this->getManufacturer()) {
|
||||
return $this->getManufacturer()->getAutoProductUrl($this->name);
|
||||
//If possible use the MPN to resolve the auto product URL, otherwise use the parts name
|
||||
$mpn = $this->getManufacturerProductNumber();
|
||||
if (empty($mpn)) {
|
||||
$mpn = $this->getName();
|
||||
}
|
||||
return $this->getManufacturer()->getAutoProductUrl($mpn);
|
||||
}
|
||||
|
||||
return ''; // no url is available
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue