config->canDisplay(); } public function getCmsContent(): string { $identifier = $this->config->getCmsBlockIdentifier(); if ($identifier === '') { return ''; } $content = $this->getLayout()->createBlock( BlockByIdentifier::class, 'esun.promotion.popup.cms.' . sha1($identifier) ); if (!$content) { return ''; } return $content->setData('identifier', $identifier)->toHtml(); } public function getJsonConfig(): string { return $this->json->serialize([ 'websiteId' => $this->config->getWebsiteId(), 'campaignKey' => sha1($this->config->getCmsBlockIdentifier()), 'campaignVersion' => $this->config->getCampaignVersion(), 'displayDelay' => $this->config->getDisplayDelay(), 'frequency' => $this->config->getFrequency(), 'audience' => $this->config->getAudience(), ]); } }