cookiesPlusData = $cookiesPlusData; $this->smarty = $smarty; $this->context = Context::getContext(); $this->shop = new Shop((int) Context::getContext()->shop->id); } /** * Returns the template's HTML footer * * @return string HTML footer * * @throws SmartyException */ public function getFooter() { $shop_address = $this->getShopAddress(); $this->smarty->assign([ 'available_in_your_account' => false, 'shop_address' => $shop_address, 'shop_fax' => Configuration::get('PS_SHOP_FAX'), 'shop_phone' => Configuration::get('PS_SHOP_PHONE'), 'shop_details' => Configuration::get('PS_SHOP_DETAILS'), 'free_text' => '', ]); return $this->smarty->fetch($this->getTemplate('footer')); } /** * Returns the template's HTML content * * @return string HTML content * * @throws SmartyException */ public function getContent() { // Generate smarty data $this->smarty->assign([ 'info' => $this->cookiesPlusData['info'], 'finalities' => $this->cookiesPlusData['cookiesPlusFinalities'], ]); // Generate templates after, to be able to reuse data above $this->smarty->assign([ 'style' => $this->smarty->fetch($this->getCookiesPlusTemplate('style')), 'info' => $this->smarty->fetch($this->getCookiesPlusTemplate('info')), 'finalities' => $this->smarty->fetch($this->getCookiesPlusTemplate('finalities')), ]); return $this->smarty->fetch($this->getCookiesPlusTemplate('consent')); } /** * Returns the template filename * * @return string filename */ public function getFilename() { return _PS_MODULE_DIR_ . 'cookiesplus/consent/' . $this->cookiesPlusData['info']['consent_hash'] . '.pdf'; } /** * Returns the template filename * * @return string filename */ public function getBulkFilename() { return _PS_MODULE_DIR_ . 'cookiesplus/consent/' . $this->cookiesPlusData['info']['consent_hash'] . '.pdf'; } /** * If the template is not present in the theme directory, it will return the default template * in _PS_PDF_DIR_ directory * * @param string $template_name * * @return string */ protected function getCookiesPlusTemplate($template_name) { return _PS_MODULE_DIR_ . 'cookiesplus/views/templates/front/pdf/' . $template_name . '.tpl'; } }