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)
-   -   Highlight Product Quantity on Invoice (https://forum.x-cart.com/showthread.php?t=39360)

spacetoast 04-25-2008 09:36 AM

Highlight Product Quantity on Invoice
 
Hi!

When we print out our invoices to make orders, we have to carefully examine each invoice to verify the quantity because there have been times where we've just missed the fact that there were 2 items ordered rather than 1.

To avoid these errors, we would use a highlighter to highlight any product that had more than 1 item. I finally got tired of doing this and decided to figure out how to have x-cart do it.

This is for 4.0.17, but I'm sure it is pretty similar for other versions.

In skin1/mail/html/order_data.tpl

Near line 50, Find:
Code:

<TD align="center">{$product.amount}</TD>

Replace with:
Code:

<TD align="center">
{if $product.amount eq 1}
{$product.amount}
{else}
<FONT
style="BACKGROUND-COLOR: yellow">&nbsp {$product.amount} &nbsp</FONT>
{/if}
</TD>


This will highlight a quantity greater than 1.

I haven't tried yet, but if I were to throw in an if statement to filter the user type for Admin only, would that make it so that the emails sent to customers were not highlighted?

I hope this can help someone!
:D

Edit: If you aren't printing on a color printer, you might want to change the background color to something that works better with black and white if the yellow isn't doing it for you.

Edit2: You also have to make sure that in your browser options you have it set to print background color otherwise it won't work.

markwhoo 04-28-2008 07:25 PM

Re: Highlight Product Quantity on Invoice
 
If you really want to make a change to allow customers to see plain invoice while keeping your highlighted values over one, just tweak your code to this:

Code:

<td align="center">
{if $usertype eq "P" or $usertype eq "A"}
{if $product.amount eq 1}
{$product.amount}
{else}
<FONT style="BACKGROUND-COLOR: yellow">&nbsp {$product.amount} &nbsp</FONT>
{/if}
{else}
{$product.amount}{/if}
</td>


Just food for thought if interested...

spacetoast 04-29-2008 07:22 AM

Re: Highlight Product Quantity on Invoice
 
That worked exactly how I hoped it would. I just made the change and tested it.

Highlighted when logged in as Admin, not highlighted when logged in as customer. Also, the confirmation email to the customer is not highlighted.

Thanks, markwhoo!

I know this is a very simple mod, but since I made the change several days ago, it has saved us a lot of time since we would have to go through orders every morning and look for multiple items. This in combination with the "Printing 'Customer Notes' on invoices" mod (for pre 4.1.x carts) has eliminated the need to look through the orders on the screen. Now we just print the invoices off and look directly at them for all the info we need to know to make the orders.


All times are GMT -8. The time now is 10:08 AM.

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