Merge branch 'fix/correcciones_secundarias' into dev
This commit is contained in:
@@ -95,25 +95,7 @@ class Variant extends Model
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
$name = $this->catalogItem->nombre;
|
||||
$this->loadMissing(['definitions.itemAttribute.attribute', 'eventDate']);
|
||||
$definitions = $this->definitions
|
||||
->map(function (VariantDefinition $definition): ?string {
|
||||
$attributeName = $definition->itemAttribute?->attribute?->nombre;
|
||||
|
||||
return $attributeName
|
||||
? "{$attributeName}: {$definition->value}"
|
||||
: $definition->value;
|
||||
})
|
||||
->filter();
|
||||
|
||||
if ($this->eventDate !== null) {
|
||||
$definitions->push('Fecha: '.$this->eventDate->date->format('Y-m-d'));
|
||||
}
|
||||
|
||||
$description = $definitions->implode(', ');
|
||||
|
||||
return $description === '' ? $name : "{$name} ({$description})";
|
||||
return $this->catalogItem->nombre;
|
||||
}
|
||||
|
||||
public function getMinimumUseDate(): ?CarbonInterface
|
||||
|
||||
Reference in New Issue
Block a user