Jump to content

PS_LOGO_MAIL returning incorrect value


Recommended Posts

Hello, I've set up the Mail.php file to not attach the logo to the email, in order to prevent the message being marked as spam.  I did this using the suggestions on this forum:

 

commenting two lines and adding lines, as below:

/* don't attach the logo as */
            //if (isset($logo))
            //    $template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));
            //NEW! replacement:
            if (Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop))){
                $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop);
                $template_vars['{shop_logo}'] = $logo;
                }
            else
            {
                if (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop))){
                    $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop);
                    $template_vars['{shop_logo}'] = $logo;
                    }
                else
                    $template_vars['{shop_logo}'] = '';
            }

However the configuration controller seems to be returning an invalid link for the logo.  I'm on shared hosting.  The link should be:

http://myshop.com/shop/img/logo.jpg

 

But instead it is

http://homepages/23/customerID/htdocs/myshop_root_folder/shop/img/logo.jpg

 

It looks like whatever is calculating the link is getting confused by the shared hosting root folders and adding them incorrectly with no domain at the front.

How can this be fixed?

Edited by drlava (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...