Forums / General Questions / Long text does not wrap on invoice or packing list

Long text does not wrap on invoice or packing list

Views: 878

Results 1 to 4 of 4
4 Sep 2014, 8:29 PM
#1
llemberg avatar

llemberg

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Long text does not wrap on invoice or packing list

I have been using v1.3.8 for several years, and recently came across the need to allow customers to enter rather lengthy text (up to 1000 characters) in an attribute textarea field. I got the long text attribute all working, but discovered that the long text prints on one line on an invoice, so the majority of the text is off the page and not visible.

I found this closed thread http://www.zen-cart.com/showthread.php?57171-No-text-wrap which is quite old, but mentions that a fix for this problem was in the works. I am rebuilding my site using a fresh install of v1.5.3, but I still see the problem.

Is this fix available, or on the way? I'm thinking I could hack some PHP to do the text wrap for me, but if there's a real fix that would of course be preferable.

Thanks,
Lars
chessieshop.com

4 Sep 2014, 8:37 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,885
Plugin Contributions:
20

Re: Long text does not wrap on invoice or packing list

Don't know about what your template does but, all the <td> in the table do not have nowrap in their call on mine.
You might try a combination of the things mentioned in http://tinyurl.com/oqo9cud

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

4 Sep 2014, 10:38 PM
#3
llemberg avatar

llemberg

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Long text does not wrap on invoice or packing list

dbltoe,
Thanks for the reply. That turned out to not be a solution, because I found the problem to be the use of <nobr> tags in invoice.php and packingslip.php, which no amount of css would override, at least in Firefox. I didn't try it in other browsers. I removed the <nobr> and matching </nobr> tags from those two files, and my problem is solved.

From what I found while researching this problem, the use of <nobr> is somewhat frowned upon (http://www.w3.org/wiki/HTML/Elements/nobr) and I wonder if the Zen-Cart developers would consider removing it? It is used in

order.php
paypal.php
paypalwpp.php
invoice.php
orders.php
packingslip.php

Lars

4 Sep 2014, 11:30 PM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,885
Plugin Contributions:
20

Re: Long text does not wrap on invoice or packing list

It is rather interesting that the packingslip.php product listing only uses the <nobr> IF the attributes are >0:blink:

It does a <br> (also incorrectly coded) from the product title, adds a <small> tag, and then starts a <i> for each attribute. This will perform differently in HTML5 vs HTML4 because of the <i>.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com