configProvider = $configProvider; $this->helper = $helper; } public function execute(SaleableInterface $saleableItem, array $arguments): bool { // if Item not a product - show price $isNotProduct = !($saleableItem instanceof ProductInterface); // is current price block zone is not list, view or option $isNoZone = (key_exists('zone', $arguments) && !in_array( $arguments['zone'], [PricingRender::ZONE_ITEM_LIST, PricingRender::ZONE_ITEM_VIEW, PricingRender::ZONE_ITEM_OPTION] ) ); $isShowPrice = !$this->configProvider->isEnabled() || $isNotProduct || $isNoZone || !$this->helper->isNeedHideProduct($saleableItem); return $isShowPrice; } }