X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Adding Images to the Invoice (https://forum.x-cart.com/showthread.php?t=70618)

minfinger 11-25-2014 09:55 AM

Adding Images to the Invoice
 
How would I go about adding images to the email invoice and the online Invoice?

tony_sologubov 11-26-2014 06:21 AM

Re: Adding Images to the Invoice
 
You should edit the notification template according to:
http://kb.x-cart.com/display/XDD/Basic+guide+to+theme+creation#Basicguidetothemecre ation-UsingCustomSkinmodule

As for pulling product image, you can do this like this in template:
{product.getImage()}

minfinger 11-30-2014 05:23 PM

Re: Adding Images to the Invoice
 
So how do I determine which tpl to look for...There are hundreds of them. I'd like the picture to show up everywhere it shows information about the order, on the admin, the front end, and in the email notification. How do I figure all that out without spending hours poking through tpls?

tony_sologubov 12-01-2014 04:57 AM

Re: Adding Images to the Invoice
 
You can use Webmaster Kit module on the Order invoice page in admin area.

If you find that you need to put your image into, let's say, admin/en/order/invoice/body.tpl template, it means that you need to actually insert an image into skins/mail/en/order/invoice/body.tpl template in order to add image to an email notification.

Anyway, if you tell me where exactly you want to show an image in the notification, I will be able to tell you a specific template.

minfinger 12-04-2014 05:06 PM

Re: Adding Images to the Invoice
 
I want to insert a Column next to Item in the Order Details in the Admin area and the end user view. It's also import that when the emails get generate that go to the user and various departments that the Column with the image be there as well.
http://i21.photobucket.com/albums/b298/fasterthanyours/Invoiceinemail.jpg

tony_sologubov 12-05-2014 01:21 AM

Re: Adding Images to the Invoice
 
Does it mean that your product image should be displayed in an area marked by red on my snapshot?
http://awesomescreenshot.com/0453z4fac3

minfinger 12-05-2014 01:58 AM

Re: Adding Images to the Invoice
 
No on the left of the Item Column in a new Column.

tony_sologubov 12-09-2014 04:59 AM

Re: Adding Images to the Invoice
 
OK, in this case you mod will work as follows:

0) The product's table is rendered according to the skins/admin/en/order/invoice/parts/items/items.tpl template. Of course, I am talking about admin area right now, but let's solve the problem for invoice in admin area first, so you could get an idea of approach and then you will be able to simply re-apply change to mail notifications.

1) You need to insert a template that will define a new column of the table into the "invoice.items.head" view list. The process is described here: http://kb.x-cart.com/display/XDD/Step+2+-+applying+design+changes#Step2-applyingdesignchanges-Addingnewtemplatesandwidgets

The code of such template will be something really easy like:
Code:

{* vim: set ts=2 sw=2 sts=2 et: *}

{**
 * @ListChild (list="invoice.items.head", weight="5")
 *}
<th class="item">Image</th>


2) Then, you need to insert a template into "invoice.item" view list. This template code will be simple as well:
Code:

{* vim: set ts=2 sw=2 sts=2 et: *}

{**
 * @ListChild (list="invoice.item", weight="5")
 *}
<th class="item"><widget class="\XLite\View\Image" image="{item.getImage()}"
    alt="{item.getName()}" maxWidth="80" maxHeight="80" /></th>


Please, let me know if it makes sense to you.

minfinger 12-11-2014 04:43 PM

Re: Adding Images to the Invoice
 
It makes sense, but I'm still lost. I used the webmaster tools, but I don't understand how to figure out which tpl the columns are in. I'ts not clear to me whether or not this is a Module or if I'm modding the files on the server.

tony_sologubov 12-16-2014 05:06 AM

Re: Adding Images to the Invoice
 
Hi Michael!

Let us add a product image for product table for order invoice that displayed in admin area first. It will be an example of you, so you could grasp an idea.

I assume, you create a mod with developer ID DevId and module ID ModuleId

1) Create the skins/admin/en/modules/DevId/ModuleId/head.tpl template with the content:
Code:

{* vim: set ts=2 sw=2 sts=2 et: *}

{**
 * @ListChild (list="invoice.items.head", weight="5")
 *}
<th class="item">Image</th>


2) Create the skins/admin/en/modules/DevId/ModuleId/image.tpl template with the content:
Code:

{* vim: set ts=2 sw=2 sts=2 et: *}

{**
 * @ListChild (list="invoice.item", weight="5")
 *}
<widget class="\XLite\View\Image" image="{item.getImage()}"
    alt="{item.getName()}" maxWidth="80" maxHeight="80" />


After you do this, your order invoices in admin area will start displaying product images.

Try this and let me know if it works for you.


All times are GMT -8. The time now is 07:31 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.