$parent = $this->getParent(); | $parent = $this->getParent(); | ||||
$title = $parent ? $parent->getTitle() . ' - ' : ''; | $title = $parent ? $parent->getTitle() . ' - ' : ''; | ||||
$title .= $this->getTitle(); | $title .= $this->getTitle(); | ||||
return $title; | return $title; | ||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
public function hasProductFamilyOnline(): self | public function hasProductFamilyOnline(): self | ||||
{ | { | ||||
$this->joinProductFamilies(); | $this->joinProductFamilies(); |
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
$query->orderBy('position'); | |||||
$query->addOrderBy('.parent')->addOrderBy('.position'); | |||||
return $query; | return $query; | ||||
} | } | ||||