stylingc Posted March 2, 2017 Share Posted March 2, 2017 (edited) Hi guys!I was thinking of something that really is annoying me. I have tried to get rid of it but didn't know how to, and ofcourse I did some google research before starting this post.For example you have a show name: Prestashop | Best solution in the worldand the same shop title is showing everywhere.. in PDF invoices, in emails to customers at orders and so on...Can we somehow keep a shop title, but remove it evereywhere else?Like in PDF or emails that it only says for example: PrestashopMaybe put the shop title in some PHP file somewhere so its only showing on the webpage/shop.I hope I explained this well.. thanks! Edited March 2, 2017 by stylingc (see edit history) Link to comment Share on other sites More sharing options...
stylingc Posted March 6, 2017 Author Share Posted March 6, 2017 ???? Link to comment Share on other sites More sharing options...
rocky Posted March 7, 2017 Share Posted March 7, 2017 You'll need to edit the email templates in the mails directory and the TPL files in the pdf directory to hardcode the shop name instead of using the variable. Link to comment Share on other sites More sharing options...
stylingc Posted March 7, 2017 Author Share Posted March 7, 2017 You'll need to edit the email templates in the mails directory and the TPL files in the pdf directory to hardcode the shop name instead of using the variable. Thanks for the answer! Do you know which TPL files I should change?? Link to comment Share on other sites More sharing options...
rocky Posted March 7, 2017 Share Posted March 7, 2017 Actually, now that I think about it, an easier solution would be to override classes/HTMLTemplate.php so you don't need to modify any TPL files. Try creating override/classes/HTMLTemplate.php with the following: <?php abstract class HTMLTemplate extends HTMLTemplateCore { public function assignCommonHeaderData() { parent::assignCommonHeaderData(); $shop_name = Configuration::get('PS_SHOP_NAME', null, null, $id_shop); if (Tools::strpos($shop_name, '|') !== false) { $shop_name = Tools::substr($shop_name, 0, Tools::strpos('|', $shop_name) - 1); } $this->smarty->assign('shop_name', $shop_name); } } This should remove | and anything after it from the shop name. Remember to go to the Advanced Parameters > Performance tab and then click the "Clear cache" button (or manually delete cache/class_index.php) so PrestaShop can find the override. Link to comment Share on other sites More sharing options...
stylingc Posted March 8, 2017 Author Share Posted March 8, 2017 Thank you... but didn't work!Created the file HTMLTemplate.php and put it under "override/classes/" , deleted cache but still the PDFs, the emails from store and everything still involves the complete store name? Link to comment Share on other sites More sharing options...
rocky Posted March 9, 2017 Share Posted March 9, 2017 Try the following instead. I tested it this time and it works on the shop name in the footer of the PDFs: <?php abstract class HTMLTemplate extends HTMLTemplateCore { protected function getShopAddress() { $shop_address = parent::getShopAddress(); if (Tools::strpos($shop_address, '|') !== false) { $shop_address = Tools::substr($shop_address, 0, Tools::strpos($shop_address, '|') - 1).Tools::substr($shop_address, Tools::strpos($shop_address, ' - ')); } return $shop_address; } } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now