0

How can I use substr to truncate the SKU of Magento's invoices? The relevant code is:

    // draw SKU
    $lines[0][] = array(
        'text' => Mage::helper('core/string')->str_split($this->getSku($item), 19),
        'feed' => $pdf->margin['left'] + 25,
        'font_size' => $fontSize
    );

1 Answer 1

0

The following returns the first 19 characters of $sku.

substr($sku, 0, 19);  
1
  • Thanks, but where would I place this in the code?
    – Dan
    Commented Apr 11, 2015 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.