Hi All,
I am trying to add the store logo to the invoice shown in the admin so that the shop can straight away print it off from there and have a professional looking invoice. Any ideas how to do it?
I have tried to modify the file admin\view\template\customer\order_invoice.tpl. I have the logo in the admin\view\image folder. But still the image is not loaded. There is a box with the correct alt tag though.
Any suggestions?
Code below.
<body>
<h1><?php echo $text_invoice; ?></h1>
<div class="div1">
<table width="100%">
<tr>
<td>
<img src="admin/view/image/logo.jpg" alt="<?php echo $store; ?>"/><br />
<?php echo $store; ?><br />
<?php echo $address; ?><br />
<?php echo $text_telephone; ?> <?php echo $telephone; ?><br />
<?php if ($fax) { ?>
<?php echo $text_fax; ?> <?php echo $fax; ?><br />
<?php } ?>
<?php echo $email; ?><br />
<?php echo $website; ?></td>
<td align="right" valign="top"><table>
<tr>
<td><b><?php echo $text_invoice_date; ?></b></td>
I am trying to add the store logo to the invoice shown in the admin so that the shop can straight away print it off from there and have a professional looking invoice. Any ideas how to do it?
I have tried to modify the file admin\view\template\customer\order_invoice.tpl. I have the logo in the admin\view\image folder. But still the image is not loaded. There is a box with the correct alt tag though.
Any suggestions?
Code below.
<body>
<h1><?php echo $text_invoice; ?></h1>
<div class="div1">
<table width="100%">
<tr>
<td>
<img src="admin/view/image/logo.jpg" alt="<?php echo $store; ?>"/><br />
<?php echo $store; ?><br />
<?php echo $address; ?><br />
<?php echo $text_telephone; ?> <?php echo $telephone; ?><br />
<?php if ($fax) { ?>
<?php echo $text_fax; ?> <?php echo $fax; ?><br />
<?php } ?>
<?php echo $email; ?><br />
<?php echo $website; ?></td>
<td align="right" valign="top"><table>
<tr>
<td><b><?php echo $text_invoice_date; ?></b></td>
www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel
Hi Codebits,
tried that. doesnt work. I get an error on my invoice saying
"Notice: Undefined variable: logo in C:\server\xampp\htdocs\opencart\admin\view\template\customer\order_invoice.tpl on line 16
tried that. doesnt work. I get an error on my invoice saying
"Notice: Undefined variable: logo in C:\server\xampp\htdocs\opencart\admin\view\template\customer\order_invoice.tpl on line 16
www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel
Are you running this local or on a hosted windows server?
Doesn't make sense that its giving an error of Undefined variable <img src="" /> isn't a variable and the variable of [$store] is already registered.
Have you tried taking out <?php echo $store; ?> from the alt attribute?
Have you tried using an absolute path instead of a relative path?
Doesn't make sense that its giving an error of Undefined variable <img src="" /> isn't a variable and the variable of [$store] is already registered.
Have you tried taking out <?php echo $store; ?> from the alt attribute?
Have you tried using an absolute path instead of a relative path?
Hi Codebits. I am running this on a local server. I have tried to take our the alt tag too.
Can you tell me what is an absolute path and relative path? I thought I was using the absolute path with "/admin/view/image/logo.jpg". Is that what you mean?
Can you tell me what is an absolute path and relative path? I thought I was using the absolute path with "/admin/view/image/logo.jpg". Is that what you mean?
www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel
Absolute Path: http://yourDomainName.com/admin/view/image/logo.jpgvimal wrote:Hi Codebits. I am running this on a local server. I have tried to take our the alt tag too.
Can you tell me what is an absolute path and relative path? I thought I was using the absolute path with "/admin/view/image/logo.jpg". Is that what you mean?
Relative Path: /admin/view/image/logo.jpg
Tried it. Still doesn't work. I tried putting the absolute link in IE browser and it didn't show the pic too.
In IE, in the store admin/setting/image I can see my store logo nicely displayed. So like you said that logo should not be unknown. Other than putting the link to the pic in the order_invoice.tpl and of course having the pic located in the correct folder is there any other things that I should be doing?
In IE, in the store admin/setting/image I can see my store logo nicely displayed. So like you said that logo should not be unknown. Other than putting the link to the pic in the order_invoice.tpl and of course having the pic located in the correct folder is there any other things that I should be doing?
www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel
try right clicking on your logo and viewing image, then getting the absolute url from the address bar.
If you can view the image that way, the url you get will be the one to use.
There is no reason why a image in that folder is not viewable, unless you have changed the permissions on the folder?
If you can view the image that way, the url you get will be the one to use.
There is no reason why a image in that folder is not viewable, unless you have changed the permissions on the folder?
Hi Gavin,
I have given all permssions to all users. When I right click on the image I dont get the view image option.
Any help is greatly appreciated.
Vimal.
I have given all permssions to all users. When I right click on the image I dont get the view image option.
Any help is greatly appreciated.
Vimal.
www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel
Hi CodeBits,
I am on a local server. Set it up on my computer before I can migrate my existing shop onto opencart. I think it is not a big issue. May be I have messed up the rights and hence it doesn't work. Hopefully in the live server it will work.
Thanks for all your and Galvin's help.
Vimal.
I am on a local server. Set it up on my computer before I can migrate my existing shop onto opencart. I think it is not a big issue. May be I have messed up the rights and hence it doesn't work. Hopefully in the live server it will work.
Thanks for all your and Galvin's help.
Vimal.
www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel
Hy!
I think about now you solved the problem, but for the new people that searches i will put the example of how it works for me.
in: admin\view\template\customer\order_invoice.tpl
before: <?php echo $store; ?><br />
i was putting: <img src="/image/logo1.png" alt="<?php echo $store; ?>" width="214" height="59"/><br />
where the "logo1" for me is another picture at w214Xh59; but for the standard logo of your store use "logo.png" or gif or jpeg etc. depends what termination you use for the picture.
The logo must be in root image folder to work as it is shown. And give some refresh at you browser.
(THANK YOU ALL for the help/support/contributions of that great OPENCART script - is great !)
I think about now you solved the problem, but for the new people that searches i will put the example of how it works for me.
in: admin\view\template\customer\order_invoice.tpl
before: <?php echo $store; ?><br />
i was putting: <img src="/image/logo1.png" alt="<?php echo $store; ?>" width="214" height="59"/><br />
where the "logo1" for me is another picture at w214Xh59; but for the standard logo of your store use "logo.png" or gif or jpeg etc. depends what termination you use for the picture.
The logo must be in root image folder to work as it is shown. And give some refresh at you browser.
(THANK YOU ALL for the help/support/contributions of that great OPENCART script - is great !)
Thanks for this, I've managed to add my logo to the invoice.
I tried to follow the same principle for adding Shipping Method and Payment Method as it appears in the order confirmation email but I'm running into problems and getting an undefined variable error.
Can anyone point me in the right direction?
Thanks, Melanie
I tried to follow the same principle for adding Shipping Method and Payment Method as it appears in the order confirmation email but I'm running into problems and getting an undefined variable error.
Can anyone point me in the right direction?
Thanks, Melanie
Hey, if i remember correctly you will have to add the <img> line twice into the tpl file.
The first time its for the a single(or the first) invoice generated, then somewere else you have to add it again if you want to print mutliple invoices at once all containing store logo! (this was in 1.4.4 i think)
The first time its for the a single(or the first) invoice generated, then somewere else you have to add it again if you want to print mutliple invoices at once all containing store logo! (this was in 1.4.4 i think)
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 - simples
Code: 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>
Following ifyouseeks advice worked a treat, and took me less that 2mins to do. Well done.
Who is online
Users browsing this forum: No registered users and 173 guests