Jump to content

Shop name annoying...


Recommended Posts

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 world
and 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: Prestashop

Maybe 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 by stylingc (see edit history)
Link to comment
Share on other sites

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...