CodeExplorer hasListing example
$isHomePage =
$context->
getShop()->
getCategory()->
getId() ===
$categoryId;
$devicesWithListing =
$this->
getDevicesWithListing($emotions);
if ($isHomePage) { $devicesWithListing =
[];
} return [ 'emotions' =>
$emotions,
'hasEmotion' => !
empty($emotions),
'showListing' =>
$this->
hasListing($emotions,
$devicesWithListing),
'showListingDevices' =>
$devicesWithListing,
'isHomePage' =>
$isHomePage,
'showListingButton' =>
$this->
hasProducts($categoryId,
$context,
$streamId),
];
} private function hasProducts(int
$categoryId, ShopContextInterface
$context, ?int
$streamId): bool
{ if ($this->
Request()->
getParam('sPage'
)) { return false;
}