X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   INVOICE PRINTING ENHANCEMENTS (W/ PRINTINGPAGE BREAKING!!) (https://forum.x-cart.com/showthread.php?t=10108)

fernando 10-30-2004 08:37 AM

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!!

adpboss 10-30-2004 02:32 PM

isn't page breaking a standard in 4.0? If I recall it was implemented in 3.5

fernando 10-30-2004 02:42 PM

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.

adpboss 10-30-2004 02:49 PM

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. :D

fernando 10-30-2004 02:57 PM

Ah-ha!! :oops:

Didn't see that option until you pointed it out for me. Thanks, and glad the 2nd mod can be useful!

adpboss 10-30-2004 03:07 PM

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.


All times are GMT -8. The time now is 05:37 PM.

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