Skip to content

Commit

Permalink
Fix body classes for manufacturer and supplier listings
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlavtox committed Feb 12, 2023
1 parent 9e8cff8 commit 5803a3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions controllers/front/listing/ManufacturerController.php
Expand Up @@ -239,8 +239,10 @@ public function getTemplateVarPage()
{
$page = parent::getTemplateVarPage();

$page['body_classes']['manufacturer-id-' . $this->manufacturer->id] = true;
$page['body_classes']['manufacturer-' . $this->manufacturer->name] = true;
if (Validate::isLoadedObject($this->manufacturer) && $this->manufacturer->active && $this->manufacturer->isAssociatedToShop()) {
$page['body_classes']['manufacturer-id-' . $this->manufacturer->id] = true;
$page['body_classes']['manufacturer-' . $this->manufacturer->name] = true;
}

return $page;
}
Expand Down
6 changes: 4 additions & 2 deletions controllers/front/listing/SupplierController.php
Expand Up @@ -242,8 +242,10 @@ public function getTemplateVarPage()
{
$page = parent::getTemplateVarPage();

$page['body_classes']['supplier-id-' . $this->supplier->id] = true;
$page['body_classes']['supplier-' . $this->supplier->name] = true;
if (Validate::isLoadedObject($this->supplier) && $this->supplier->active && $this->supplier->isAssociatedToShop()) {
$page['body_classes']['supplier-id-' . $this->supplier->id] = true;
$page['body_classes']['supplier-' . $this->supplier->name] = true;
}

return $page;
}
Expand Down

0 comments on commit 5803a3a

Please sign in to comment.