[-] BO : #PSTEST-667 - Fix bug with logo and multishop
This commit is contained in:
+2
-2
@@ -187,8 +187,8 @@ class MailCore
|
||||
|
||||
/* Create mail and attach differents parts */
|
||||
$message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME').'] '.$subject);
|
||||
$templateVars['{shop_logo}'] = (file_exists(_PS_IMG_DIR_.'logo_mail.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo_mail.jpg'))) :
|
||||
((file_exists(_PS_IMG_DIR_.'logo.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo.jpg'))) : '');
|
||||
$templateVars['{shop_logo}'] = (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL'))) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL')))) :
|
||||
((file_exists(_PS_IMG_DIR_.'logo.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.Configuration::get('PS_LOGO')) : '');
|
||||
$templateVars['{shop_name}'] = Tools::safeOutput(Configuration::get('PS_SHOP_NAME'));
|
||||
$templateVars['{shop_url}'] = Tools::getShopDomain(true, true).__PS_BASE_URI__;
|
||||
$swift->attachPlugin(new Swift_Plugin_Decorator(array($to_plugin => $templateVars)), 'decorator');
|
||||
|
||||
@@ -670,7 +670,8 @@ class FrontControllerCore extends Controller
|
||||
'logo_image_width' => Configuration::get('SHOP_LOGO_WIDTH'),
|
||||
'logo_image_height' => Configuration::get('SHOP_LOGO_HEIGHT'),
|
||||
'priceDisplayPrecision' => _PS_PRICE_DISPLAY_PRECISION_,
|
||||
'content_only' => (int)Tools::getValue('content_only')
|
||||
'content_only' => (int)Tools::getValue('content_only'),
|
||||
'logo_url' => _PS_IMG_.Configuration::get('PS_LOGO').'?'.Configuration::get('PS_IMG_UPDATE_TIME')
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -104,10 +104,10 @@ abstract class HTMLTemplateCore
|
||||
{
|
||||
$logo = '';
|
||||
|
||||
if (file_exists(_PS_IMG_DIR_.'logo_invoice.jpg'))
|
||||
$logo = _PS_IMG_.'logo_invoice.jpg';
|
||||
else if (file_exists(_PS_IMG_DIR_.'logo.jpg'))
|
||||
$logo = _PS_IMG_.'logo.jpg';
|
||||
if (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE')))
|
||||
$logo = _PS_IMG_.Configuration::get('PS_LOGO_INVOICE');
|
||||
else if (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO')))
|
||||
$logo = _PS_IMG_.Configuration::get('PS_LOGO');
|
||||
|
||||
return $logo;
|
||||
}
|
||||
|
||||
@@ -333,8 +333,8 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
case 'mail':
|
||||
if (in_array($this->wsObject->method, array('GET','HEAD','PUT')))
|
||||
{
|
||||
$path = _PS_IMG_DIR_.'logo_mail.jpg';
|
||||
$alternative_path = _PS_IMG_DIR_.'logo.jpg';
|
||||
$path = _PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL');
|
||||
$alternative_path = _PS_IMG_DIR_.Configuration::get('PS_LOGO');
|
||||
}
|
||||
else
|
||||
throw new WebserviceException('This method is not allowed with general image resources.', array(50, 405));
|
||||
@@ -344,8 +344,8 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
case 'invoice':
|
||||
if (in_array($this->wsObject->method, array('GET','HEAD','PUT')))
|
||||
{
|
||||
$path = _PS_IMG_DIR_.'logo_invoice.jpg';
|
||||
$alternative_path = _PS_IMG_DIR_.'logo.jpg';
|
||||
$path = _PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE');
|
||||
$alternative_path = _PS_IMG_DIR_.Configuration::get('PS_LOGO');
|
||||
}
|
||||
else
|
||||
throw new WebserviceException('This method is not allowed with general image resources.', array(51, 405));
|
||||
|
||||
Reference in New Issue
Block a user