0

I want to edit the code inside app/code/core/Mage/Sales/Model/Order/Pdf/items/Invoice/Default.php

so each product option has the format Label - Value, instead of taking up multiple lines; as this creates a 2 page pdf when the contained information can be displayed on a single page.

Any advice someone can offer would be greatly appreciated, as it's one of the last issues I have to complete before I'm finished.

0

1 Answer 1

0
  $lines[][] = array(
                        'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true),
                        'font' => 'italic',
                        'feed' => 35
                    );

                    if ($option['value']) {
                        if (isset($option['print_value'])) {
                            $_printValue = $option['print_value'];
                        } else {
                            $_printValue = strip_tags($option['value']);
                        }
                        $values = explode(', ', $_printValue);
                        foreach ($values as $value) {
                            $lines[][] = array(
                                'text' => Mage::helper('core/string')->str_split($value, 30, true, true),
                                'feed' => 40
                            );
                        }
                    }

replace with

$lines[][] = array(
                    'text' => Mage::helper('core/string')->str_split(strip_tags($option['label'].':'.$option['value']), 40, true, true),
                    'font' => 'italic',
                    'feed' => 35
                );

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.