Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Truncate Product Name in Packing Slip

Truncate Product Name in Packing Slip

Locked

Views: 1,048

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
9 May 2009, 8:17 PM
#1
maineiac13 avatar

maineiac13

New Zenner

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

Truncate Product Name in Packing Slip

Previously I was able to use the function zen_trunc_string to truncate product names in the shopping cart sidebox.

Now I would like to also truncate product names in the packing slip.

I presume that the area I need to address is here:

<tr class="dataTableRow">' . "\n" .
           '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
           '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

However, I have not been able to figure how to use the truncate function there to accomplish what I want. All my efforts have ended up with either non-functioning or blank packing slips.

So can someone lend a hand? Thanks

24 Jun 2009, 8:07 PM
#2
maineiac13 avatar

maineiac13

New Zenner

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

Re: Truncate Product Name in Packing Slip

In case anyone is interested, I was finally able to accomplish this.

First I needed to insert the truncate string function found in includes/functions/functions_general.php into admin/packingslip.php.

Then all I had to do was to modify the string relating to the product name in the packingslip.php file to read:

(zen_trunc_string($order->products[$i]['name'], 105))

The 105 is what I finally decided I wanted as the length of the product name in my packing slips...but that number can be any number that one would want to have.

25 Jun 2009, 2:09 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Truncate Product Name in Packing Slip

Thanks for posting the update to the solution to adjusting the length of the products_name field on the orders packing slip ... :smile: