Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

INVOICE PRINTING ENHANCEMENTS (W/ PRINTINGPAGE BREAKING!!)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 10-30-2004, 08:37 AM
 
fernando fernando is offline
 

Member
  
Join Date: Oct 2004
Posts: 29
 

Default INVOICE PRINTING ENHANCEMENTS (W/ PRINTINGPAGE BREAKING!!)

Allright! I was having two problems with the original main/order_invoice_print.tpl template: first, it wouldn't show additional customer fields when printing invoices. The other problem was cosmetic, but sort of a pain in the but...: when you select more than one invoice to print, you surely want each invoice on a separate page, right? This mod adds a PAGE BREAK after each printed invoice. (This was tested under MSIE 6, too lazy to test it with Netscape or Mozilla...)

Ok, here goes the mod!!!

Code:
{* $Id: order_invoice_print.tpl,v 1.9 2004/06/29 06:47:31 svowl Exp $ *} {* Modified 2004/10/30 by Fernando Borcel, MascotasMexico.com *} <HTML> <BODY> {if $config.Appearance.print_orders_separated eq "Y"} {assign var="separator" value="<DIV style='page-break-after:always'></DIV>"} {else} {assign var="separator" value=" <HR size='1' noshade> "} {/if} {section name=oi loop=$orders_data} {* include file="mail/html/order_invoice.tpl" order=$orders_data[oi].order customer=$orders_data[oi].customer products=$orders_data[oi].products giftcerts=$orders_data[oi].giftcerts*} {* Removed by Fernando ("customer" variable doesn't exist in target tpl) *} { include file="mail/html/order_invoice.tpl" order=$orders_data[oi].order userinfo=$orders_data[oi].customer products=$orders_data[oi].products giftcerts=$orders_data[oi].giftcerts} {* Added by Fernando so that it will print additional fields properly*} {if not %oi.last%} {* $separator *} {* Removed by Fernando Don't print an separator *} <div style="page-break-after: always"></div> {* Added by Fernando Instead, do a PAGE BREAK! *} {/if} {/section} </BODY> </HTML>

Try it out and tell me how it went!!
__________________
Fernando
Sorry, I\'m not using x-cart anymore, so I am unable to reply to enquiries about modules. Thank you.
Reply With Quote
  #2  
Old 10-30-2004, 02:32 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

isn't page breaking a standard in 4.0? If I recall it was implemented in 3.5
Reply With Quote
  #3  
Old 10-30-2004, 02:42 PM
 
fernando fernando is offline
 

Member
  
Join Date: Oct 2004
Posts: 29
 

Default

Nope, I don't know about previous versions, since I'm new with XC and 405 is all I know. But all it did was drawing an horizontal ruler for separator, no page break.
__________________
Fernando
Sorry, I\'m not using x-cart anymore, so I am unable to reply to enquiries about modules. Thank you.
Reply With Quote
  #4  
Old 10-30-2004, 02:49 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

From General Settings : Appearance Options

Quote:
Print order invoices on separate pages:

Order Invoice Print. You can see config.appearance switch.

Code:
{* $Id: order_invoice_print.tpl,v 1.9 2004/06/29 06:47:31 svowl Exp $ *} <HTML> <BODY> {if $config.Appearance.print_orders_separated eq "Y"} {assign var="separator" value="<DIV style='page-break-after:always'></DIV>"} {else} {assign var="separator" value=" <HR size='1' noshade> "} {/if} {section name=oi loop=$orders_data} { include file="mail/html/order_invoice.tpl" order=$orders_data[oi].order customer=$orders_data[oi].customer products=$orders_data[oi].products giftcerts=$orders_data[oi].giftcerts} {if not %oi.last%} {$separator} {/if} {/section} </BODY> </HTML>

You've got a good mod there for the additional fields though.
Reply With Quote
  #5  
Old 10-30-2004, 02:57 PM
 
fernando fernando is offline
 

Member
  
Join Date: Oct 2004
Posts: 29
 

Default

Ah-ha!!

Didn't see that option until you pointed it out for me. Thanks, and glad the 2nd mod can be useful!
__________________
Fernando
Sorry, I\'m not using x-cart anymore, so I am unable to reply to enquiries about modules. Thank you.
Reply With Quote
  #6  
Old 10-30-2004, 03:07 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

No problem. This was a missing option for a very long time in X-Cart. Some of us old timers were very happy to see it in V 3.5.

Keep on posting your work. It's great when new users share their mods for others. We all learn something.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:37 AM.

   

 
X-Cart forums © 2001-2020