Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Customizing invoice in mails Rate Topic   - - - - -

 
  • ymul
  • Member
  • Trial users
  • Join Date: 09-Aug 13
  • 41 posts

Posted 25 September 2013 - 08:35 AM #1

Hello, after reading and searching a lot, I can't bring it to work...

I want to change the content of the invoice which is included in the mails sent to the customers.

I found out that the file is :
/design/themes/basic/mail/templates/orders/invoice.tpl

Changes made directly in this file are effective. But I want to use a hook. The part I want to change in invoice.tpl is between :
{hook name="orders:invoice_company_info"}  ... {/hook}

I've created this file with my modifications
/design/themes/basic/mail/templates/addons/my_changes/hooks/orders/invoice_company_info.override.tpl

But my hook isn't used. What I'm doing wrong ?

 
  • ymul
  • Member
  • Trial users
  • Join Date: 09-Aug 13
  • 41 posts

Posted 26 September 2013 - 05:51 AM #2

Resolved ! I found out why it wasn't working : the Rebuild Cache Automatically was set to On in the Template Editor section ! Set it now to Off and my hook is working !

 
  • ymul
  • Member
  • Trial users
  • Join Date: 09-Aug 13
  • 41 posts

Posted 26 September 2013 - 05:56 AM #3

The solution was simply to clear compiled templates. It can be done with :

?dispatch=template_editor.manage&ctpl

So the Rebuild Cache Automatically can be set to On or Off and my hooks are working.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12052 posts

Posted 27 September 2013 - 01:08 AM #4

I'm surprised that the hook will be found in the mail directory given that most hooks are from within the 'templates' directory, even for 'mail'. But since this is all new, maybe they've changed the location for mail hooks to be in the 'mail' tree.

Would be nice to have cs-cart confirm/deny versus having to go through all the templater code too determine if 'mail' is handled separately from 'templates'.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • ymul
  • Member
  • Trial users
  • Join Date: 09-Aug 13
  • 41 posts

Posted 27 September 2013 - 09:16 AM #5

I'm surprised that the hook will be found in the mail directory given that most hooks are from within the 'templates' directory, even for 'mail'. But since this is all new, maybe they've changed the location for mail hooks to be in the 'mail' tree.

Would be nice to have cs-cart confirm/deny versus having to go through all the templater code too determine if 'mail' is handled separately from 'templates'.


I agree with you. First I tried to put my hook in the templates tree, I found another post in this forum about the mail tree, but for older version. In the official documentation I found nothing about CSC4 and the mail tree. I spent a lot of time trying and searching and think a the official documentation could be better. I think modifying the mail templates is something current.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12052 posts

Posted 27 September 2013 - 09:43 PM #6

Why I suggested cs-cart comment (but we could wait for that for a really long time).

A quick look at app/functions/smarty_plugins/block.hook.php indicates that hooks are resolved "relative" to the "template_area". So I would assume that "mail" hooks are now relative to the mail directory and "temlate" hooks are now relative to the "template" directory. I wonder if that means that any admin mail hooks wold be relative to the backend/mail/addons directory rather than just backend/addons?


Kinda makes sense but I would doubt there is much overload of template hooks depending on whether it's a 'mail' template or not.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • MichielTG
  • Advanced Member
  • Members
  • Join Date: 17-Aug 12
  • 65 posts

Posted 06 November 2013 - 09:00 PM #7

Notice that there is a backend and front-end invoice.tpl