Magento 1.7
instead (line 415 in the application / code / local / Magician / Sales / Model / Order / Pdf / Abstract.php, if you do not have a file on this path, copy it from the application / code / kernel / Magician / Sales. location )
foreach ($payment as $value){ if (trim($value) != '') { //Printing "Payment Method" lines $value = preg_replace('/<br[^>]*>/i', "\n", $value); foreach (Mage::helper('core/string')->str_split($value, 50, true, true, "\n") as $_value) { $page->drawText(strip_tags(trim($_value)), $paymentLeft, $yPayments, 'UTF-8'); $yPayments -= 15; } } }
use this
foreach ($payment as $value){ if (trim($value) != '') { //Printing "Payment Method" lines $value = preg_replace('/<br[^>]*>/i', "\n", $value); foreach (Mage::helper('core/string')->splitWords($value, false,false, "\n") as $_value) { $page->drawText(strip_tags(trim($_value)), $paymentLeft, $yPayments, 'UTF-8'); $yPayments -= 15; } } }
also change Mage :: helper ('core / string') → str_split for Mage :: helper ('core / string') → splitWords``
Marek source share