The Logo you are looking at (logo.png) is opencart's official logo which is white.
It will not turn up.
What works for me:
Uploaded fresh logo to somewhere (admin/image)
added the relative path (/admin/imag/mylogo.png)
saved and done !
It will not turn up.
What works for me:
Uploaded fresh logo to somewhere (admin/image)
added the relative path (/admin/imag/mylogo.png)
saved and done !
Awesome! Did it in v1.5.5.1, thank your for this solution!!Deadelus wrote:The proper way to add your logo to the invoice while using the logo configured in the admin is as follows:
1: Edit /admin/controller/sale/order.php and add the following in the invoice() method:This reads the logo image from the config and adds the correct path to it to the invoice template.Code: Select all
if ($this->config->get('config_logo') && file_exists(DIR_IMAGE . $this->config->get('config_logo'))) { $this->data['logo'] = HTTP_IMAGE . $this->config->get('config_logo'); } else { $this->data['logo'] = ''; }
2: Edit /admin/view/template/sale/order_invoice.tpl and add the following code before the <h1> tag:This checks if there actually is a logo and shows the image.Code: Select all
<?php if (!empty($logo)): ?> <img src="<?php echo $logo; ?>" alt="Logo" /> <?php endif; ?>
Please don't add hard coded paths to your templates, it will only annoy you in the future or when you changed your logo and forgot it was hard coded in your invoice template.
jsw wrote:Awesome! Did it in v1.5.5.1, thank you very much for this solution!!Deadelus wrote:The proper way to add your logo to the invoice while using the logo configured in the admin is as follows:
1: Edit /admin/controller/sale/order.php and add the following in the invoice() method:This reads the logo image from the config and adds the correct path to it to the invoice template.Code: Select all
if ($this->config->get('config_logo') && file_exists(DIR_IMAGE . $this->config->get('config_logo'))) { $this->data['logo'] = HTTP_IMAGE . $this->config->get('config_logo'); } else { $this->data['logo'] = ''; }
2: Edit /admin/view/template/sale/order_invoice.tpl and add the following code before the <h1> tag:This checks if there actually is a logo and shows the image.Code: Select all
<?php if (!empty($logo)): ?> <img src="<?php echo $logo; ?>" alt="Logo" /> <?php endif; ?>
Please don't add hard coded paths to your templates, it will only annoy you in the future or when you changed your logo and forgot it was hard coded in your invoice template.
Has anyone modified this to add an image that is different than the store logo? And possibly have it centered in the page?
I tried changinging the file path to point it to a different image and it will not come up.
Edit** Any image works if it is uploaded to the server.. forgot to upload it.
Still looking to figure out how to center it in the page!
I tried changinging the file path to point it to a different image and it will not come up.
Edit** Any image works if it is uploaded to the server.. forgot to upload it.
Still looking to figure out how to center it in the page!
To make the image centred you can add a div and centre it like so:
I have not tested this exact code but the insertion of the styling div worked on my invoice just now
(I use a vQmod which adds product image and logo to the invoice, available free here which means my order_invoice.tpl code is different to the example used here)
Hope this helps someone!
Cheers,
Stokey
Code: Select all
<?php if (!empty($logo)): ?>
<div style="text-align:center"><img src="<?php echo $logo; ?>" alt="Logo" /></div>
<?php endif; ?>
<h1><?php echo $text_invoice; ?></h1>
(I use a vQmod which adds product image and logo to the invoice, available free here which means my order_invoice.tpl code is different to the example used here)
Hope this helps someone!
Cheers,
Stokey
Stokey
Brilliant answer, just did this in less than a minute - Yay!ifyouseek wrote:to add your store logo to your invoice go to admin/view/template/sale/order_invoice.tpl and add <img src="http://yourdomain.com/image/data/title.png"> just before the H1 tag as seen below.
then go to /admin/view/template/sale/order_invoices.tpl and do the same. Just add the image tag just before the <h1> title tag - simplesCode: Select all
<?php echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction; ?>" lang="<?php echo $language; ?>" xml:lang="<?php echo $language; ?>"> <head> <title><?php echo $title; ?></title> <base href="<?php echo $base; ?>" /> <link rel="stylesheet" type="text/css" href="view/stylesheet/invoice.css" /> </head> <body> <?php foreach ($orders as $order) { ?> <div style="page-break-after: always;"> <img src="http://yourdomain.com/image/data/title.png"><h1><?php echo $text_invoice; ?></h1> <div class="div1"> <table width="100%"> <tr> <td><?php echo $order['store_name']; ?><br /> <?php echo $order['address']; ?><br /> <?php echo $text_telephone; ?> <?php echo $order['telephone']; ?><br /> <?php if ($order['fax']) { ?> <?php echo $text_fax; ?> <?php echo $order['fax']; ?><br /> <?php } ?> <?php echo $order['email']; ?><br /> <?php echo $order['store_url']; ?></td> <td align="right" valign="top"><table> <tr> <td><b><?php echo $text_date_added; ?></b></td> <td><?php echo $order['date_added']; ?></td> </tr> <?php if ($order['invoice_id']) { ?> <tr> <td><b><?php echo $text_invoice_id; ?></b></td> <td><?php echo $order['invoice_id']; ?></td> </tr> <?php } ?> <tr> <td><b><?php echo $text_order_id; ?></b></td> <td><?php echo $order['order_id']; ?></td> </tr> </table></td> </tr> </table> </div> <table class="address"> <tr class="heading"> <td width="50%"><b><?php echo $text_to; ?></b></td> <td width="50%"><b><?php echo $text_ship_to; ?></b></td> </tr> <tr> <td><?php echo $order['payment_address']; ?></td> <td><?php echo$order['shipping_address']; ?></td> </tr> </table> <table class="product"> <tr class="heading"> <td><b><?php echo $column_product; ?></b></td> <td><b><?php echo $column_model; ?></b></td> <td align="right"><b><?php echo $column_quantity; ?></b></td> <td align="right"><b><?php echo $column_price; ?></b></td> <td align="right"><b><?php echo $column_total; ?></b></td> </tr> <?php foreach ($order['product'] as $product) { ?> <tr> <td><?php echo $product['name']; ?> <?php foreach ($product['option'] as $option) { ?> <br /> <small> - <?php echo $option['name']; ?> <?php echo $option['value']; ?></small> <?php } ?></td> <td><?php echo $product['model']; ?></td> <td align="right"><?php echo $product['quantity']; ?></td> <td align="right"><?php echo $product['price']; ?></td> <td align="right"><?php echo $product['total']; ?></td> </tr> <?php } ?> <?php foreach ($order['total'] as $total) { ?> <tr> <td align="right" colspan="4"><b><?php echo $total['title']; ?></b></td> <td align="right"><?php echo $total['text']; ?></td> </tr> <?php } ?> </table> </div> <?php } ?> </body> </html>
I am getting the following error in the invoice...
Notice: Use of undefined constant HTTP_IMAGE - assumed 'HTTP_IMAGE' in /var/www/vhosts/vvvvvv.co.uk/httpdocs/admin/controller/sale/order.php on line 2343
Any ideas?
Notice: Use of undefined constant HTTP_IMAGE - assumed 'HTTP_IMAGE' in /var/www/vhosts/vvvvvv.co.uk/httpdocs/admin/controller/sale/order.php on line 2343
Any ideas?
Deadelus wrote:The proper way to add your logo to the invoice while using the logo configured in the admin is as follows:
1: Edit /admin/controller/sale/order.php and add the following in the invoice() method:This reads the logo image from the config and adds the correct path to it to the invoice template.Code: Select all
if ($this->config->get('config_logo') && file_exists(DIR_IMAGE . $this->config->get('config_logo'))) { $this->data['logo'] = HTTP_IMAGE . $this->config->get('config_logo'); } else { $this->data['logo'] = ''; }
2: Edit /admin/view/template/sale/order_invoice.tpl and add the following code before the <h1> tag:This checks if there actually is a logo and shows the image.Code: Select all
<?php if (!empty($logo)): ?> <img src="<?php echo $logo; ?>" alt="Logo" /> <?php endif; ?>
Please don't add hard coded paths to your templates, it will only annoy you in the future or when you changed your logo and forgot it was hard coded in your invoice template.
hello,
I would like to ask if anybody knows how to put surname and name on invoice? I added custom text on it and would like to add customer name and surname on this text. For expl. I ”name surname” agree with the term of use of this product, etc.....
thank you.
I would like to ask if anybody knows how to put surname and name on invoice? I added custom text on it and would like to add customer name and surname on this text. For expl. I ”name surname” agree with the term of use of this product, etc.....
thank you.
You may like these extension : - https://www.opencart.com/index.php?rout ... r=cmsrooms
Who is online
Users browsing this forum: No registered users and 112 guests