Skip to content

Commit

Permalink
[-] BO: Fix #PSCFV-7851 - shop logo and name should depend of the ord…
Browse files Browse the repository at this point in the history
…er shop and from the context
  • Loading branch information
rGaillard committed Feb 18, 2013
1 parent 08f5a01 commit 7c26ea3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
18 changes: 9 additions & 9 deletions classes/pdf/HTMLTemplate.php
Expand Up @@ -41,7 +41,7 @@ abstract class HTMLTemplateCore
*/
public function getHeader()
{
$shop_name = Configuration::get('PS_SHOP_NAME');
$shop_name = Configuration::get('PS_SHOP_NAME', null, null, (int)$this->order->id_shop);
$path_logo = $this->getLogo();

$width = 0;
Expand Down Expand Up @@ -73,10 +73,10 @@ public function getFooter()
$this->smarty->assign(array(
'available_in_your_account' => $this->available_in_your_account,
'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' => Configuration::get('PS_INVOICE_FREE_TEXT', (int)Context::getContext()->language->id)
'shop_fax' => Configuration::get('PS_SHOP_FAX', null, null, (int)$this->order->id_shop),
'shop_phone' => Configuration::get('PS_SHOP_PHONE', null, null, (int)$this->order->id_shop),
'shop_details' => Configuration::get('PS_SHOP_DETAILS', null, null, (int)$this->order->id_shop),
'free_text' => Configuration::get('PS_INVOICE_FREE_TEXT', (int)Context::getContext()->language->id, null, (int)$this->order->id_shop)
));

return $this->smarty->fetch($this->getTemplate('footer'));
Expand Down Expand Up @@ -109,10 +109,10 @@ protected function getLogo()

$physical_uri = Context::getContext()->shop->physical_uri.'img/';

if (Configuration::get('PS_LOGO_INVOICE') != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE')))
$logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE');
elseif (Configuration::get('PS_LOGO') != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO')))
$logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO');
if (Configuration::get('PS_LOGO_INVOICE', null, null, (int)$this->order->id_shop) != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE', null, null, (int)$this->order->id_shop)))
$logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE', null, null, (int)$this->order->id_shop);
elseif (Configuration::get('PS_LOGO', null, null, (int)$this->order->id_shop) != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, (int)$this->order->id_shop)))
$logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, (int)$this->order->id_shop);
return $logo;
}

Expand Down
5 changes: 5 additions & 0 deletions controllers/admin/AdminOrdersController.php
Expand Up @@ -1260,6 +1260,11 @@ public function renderView()
}

$this->toolbar_title = sprintf($this->l('Order #%1$d (%2$s) - %3$s %4$s'), $order->id, $order->reference, $customer->firstname, $customer->lastname);
if (Shop::isFeatureActive())
{
$shop = new Shop((int)$order->id_shop);
$this->toolbar_title .= ' - '.sprintf($this->l('Shop: %s'), $shop->name);
}

// gets warehouses to ship products, if and only if advanced stock management is activated
$warehouse_list = null;
Expand Down

0 comments on commit 7c26ea3

Please sign in to comment.