Mail Templates For Theme - When Are They Used

Hi there,

Just doing some housekeeping on the theme folder and noticed that there is a /themes/theme_name/mail/templates folder and curious when these would be used.

In particular, I noticed that there is an "orders" folder which contains a copy of invoice.tpl and I wonder when this template would be used. As far as I know, an invoice is generally sent from the backend. Which uses the invoice.tpl file located in /designs/backend/mail/orders

Am I right in that if one exists for the theme then that would be used instead? Thats my best guess!

Cheers..

Nathan

Hi there,

Just doing some housekeeping on the theme folder and noticed that there is a /themes/theme_name/mail/templates folder and curious when these would be used.

In particular, I noticed that there is an "orders" folder which contains a copy of invoice.tpl and I wonder when this template would be used. As far as I know, an invoice is generally sent from the backend. Which uses the invoice.tpl file located in /designs/backend/mail/orders

Am I right in that if one exists for the theme then that would be used instead? Thats my best guess!

Cheers..

Nathan

CS-Cart is using different templates for e-mails sent to customers and administrators. Admin e-mail templates are located in design/backend/mail directory and customer e-mail templates are in design/themes/[THEME_NAME]/mail directory

thanks - that makes sense.

Specifically, my query lies around the invoice that is sent for each storefront. I understand that for different themes, you may want a different invoice layout (although, I would have thought that different storefront, would dictate a different invoice layout).

I can't think of an instance where invoice.tpl would be triggered from the customer side from the theme folder. What happens if the the invoice.tpl has a different layout to the invoice.tpl in the backend? But if I send an invoice to a customer from the backend, it won't use the invoice.tpl from the theme, it will use the one from the backend. It would make more sense to me that the order you are sending the invoice for would use the invoice.tpl file from the theme that is assigned to the storefront that 'owns' that order.

Let me know if I am missing something obvious here..

Actually customers always receive invoices with the templates from the store-front. Even the invoice is send from backend

Ok, yes....

I had an issue in my theme setup whereby I was using hooks for the invoices in /design/backend and also hooks in /themes/addon/....

It appears to me that if you have it setup like this, even when sending an invoice from the backend, the hooks from the theme have priority. Deleting my hooks from the theme for the invoice mail has made sure only the backend hooks are used.

Not sure why I had those overrides in the theme, probably from a looong time ago and it never got looked at.

It seems I have confused myself on this one. I have been testing the invoice sending from several locations and confusing the results. These are the locations I have generated invoices from.

- Changing an order status

- Printing an invoice from the backend

Not sure why I thought this, but I expected when printing an invoice from the backend that I should be seeing the invoice changes from the theme.

Ok, all makes sense now....

It seems I have confused myself on this one. I have been testing the invoice sending from several locations and confusing the results. These are the locations I have generated invoices from.

- Changing an order status

- Printing an invoice from the backend

Not sure why I thought this, but I expected when printing an invoice from the backend that I should be seeing the invoice changes from the theme.

Ok, all makes sense now....

Glad to hear that you found a reason. Yes, templates from backend are used if you print invoice from the backed and vice versa