// Normalization
This commit is contained in:
@@ -110,12 +110,12 @@ abstract class HTMLTemplateCore
|
|||||||
*/
|
*/
|
||||||
protected function getLogo()
|
protected function getLogo()
|
||||||
{
|
{
|
||||||
$logo = '';
|
$logo = '';
|
||||||
|
|
||||||
// TCPDF check if the document root is present in the image path, if not it will add it.
|
// TCPDF check if the document root is present in the image path, if not it will add it.
|
||||||
// In our case, _PS_ROOT_DIR_ could be different from document_root if we use symlinks, that's why
|
// In our case, _PS_ROOT_DIR_ could be different from document_root if we use symlinks, that's why
|
||||||
// we don't use _PS_ROOT_DIR_ and we let TCPDF add the document root.
|
// we don't use _PS_ROOT_DIR_ and we let TCPDF add the document root.
|
||||||
$physical_uri = Context::getContext()->shop->physical_uri.'img/';
|
$physical_uri = Context::getContext()->shop->physical_uri.'img/';
|
||||||
|
|
||||||
if (Configuration::get('PS_LOGO_INVOICE') != false && file_exists($physical_uri.Configuration::get('PS_LOGO_INVOICE')))
|
if (Configuration::get('PS_LOGO_INVOICE') != false && file_exists($physical_uri.Configuration::get('PS_LOGO_INVOICE')))
|
||||||
$logo = $physical_uri.Configuration::get('PS_LOGO_INVOICE');
|
$logo = $physical_uri.Configuration::get('PS_LOGO_INVOICE');
|
||||||
@@ -159,26 +159,26 @@ abstract class HTMLTemplateCore
|
|||||||
*/
|
*/
|
||||||
abstract public function getBulkFilename();
|
abstract public function getBulkFilename();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the template is not present in the theme directory, it will return the default template
|
* If the template is not present in the theme directory, it will return the default template
|
||||||
* in _PS_PDF_DIR_ directory
|
* in _PS_PDF_DIR_ directory
|
||||||
*
|
*
|
||||||
* @param $template_name
|
* @param $template_name
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getTemplate($template_name)
|
protected function getTemplate($template_name)
|
||||||
{
|
{
|
||||||
$template = false;
|
$template = false;
|
||||||
$default_template = _PS_PDF_DIR_.'/'.$template_name.'.tpl';
|
$default_template = _PS_PDF_DIR_.'/'.$template_name.'.tpl';
|
||||||
$overriden_template = _PS_THEME_DIR_.'/pdf/'.$template_name.'.tpl';
|
$overriden_template = _PS_THEME_DIR_.'/pdf/'.$template_name.'.tpl';
|
||||||
|
|
||||||
if (file_exists($overriden_template))
|
if (file_exists($overriden_template))
|
||||||
$template = $overriden_template;
|
$template = $overriden_template;
|
||||||
else if (file_exists($default_template))
|
else if (file_exists($default_template))
|
||||||
$template = $default_template;
|
$template = $default_template;
|
||||||
|
|
||||||
return $template;
|
return $template;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
|||||||
'product_tax_breakdown' => $this->order_invoice->getProductTaxesBreakdown(),
|
'product_tax_breakdown' => $this->order_invoice->getProductTaxesBreakdown(),
|
||||||
'shipping_tax_breakdown' => $this->order_invoice->getShippingTaxesBreakdown($this->order),
|
'shipping_tax_breakdown' => $this->order_invoice->getShippingTaxesBreakdown($this->order),
|
||||||
'ecotax_tax_breakdown' => $this->order_invoice->getEcoTaxTaxesBreakdown(),
|
'ecotax_tax_breakdown' => $this->order_invoice->getEcoTaxTaxesBreakdown(),
|
||||||
'wrapping_tax_breakdown' => $this->order_invoice->getWrappingTaxesBreakdown(),
|
'wrapping_tax_breakdown' => $this->order_invoice->getWrappingTaxesBreakdown(),
|
||||||
'order' => $this->order,
|
'order' => $this->order,
|
||||||
'order_invoice' => $this->order_invoice
|
'order_invoice' => $this->order_invoice
|
||||||
));
|
));
|
||||||
@@ -113,12 +113,12 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
|||||||
{
|
{
|
||||||
$file = Configuration::get('PS_INVOICE_MODEL');
|
$file = Configuration::get('PS_INVOICE_MODEL');
|
||||||
|
|
||||||
// try to fetch the iso template
|
// try to fetch the iso template
|
||||||
$template = $this->getTemplate($file.'.'.$iso_country);
|
$template = $this->getTemplate($file.'.'.$iso_country);
|
||||||
|
|
||||||
// else use the default one
|
// else use the default one
|
||||||
if (!$template)
|
if (!$template)
|
||||||
$template = $this->getTemplate($file);
|
$template = $this->getTemplate($file);
|
||||||
|
|
||||||
return $template;
|
return $template;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user