2

I need to change the product details of magento packing slip currently they are showing as follows enter image description here

but I need to display as below to reduce the space taken for one product

enter image description here

Which file should I look for doing this I have looked at

app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php

and

app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php

but no luck :(

3

The file that is responsible for this task is:

app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php for simple product.

code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php for bundle product.

For Items Rendering

app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php

  • I have commented all things in Packaging.php file but no change to the packingslip printing – Chamal Chamikara Jun 23 '15 at 4:59
  • and my products are configurable products – Chamal Chamikara Jun 23 '15 at 5:00
  • Check my updated answer. – Adarsh Khatri Jun 23 '15 at 5:01
  • yes thats it app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php is the answer thank you very much :) – Chamal Chamikara Jun 23 '15 at 5:06
2

Add this to Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php, replace ATTRNAME as appropriate.:-

public function draw() { product=Mage::getModel(‘catalog/product’)->loadByAttribute(‘sku’, $this->getSku($item), array(‘ATTRNAME’)); if ($product) { $lines[0][] array(‘text’=>Mage::helper(‘core/string’)->str_split($product->getData(‘ATTRNAME’), 15), ‘feed’ => 305 ); }

Then add this to Mage/Sales/Model/Order/Pdf/Invoice.php, replace ATTR_TITLE as appropriate and OFFSET with the left offset.

/* Add table head */ … $page->drawText(Mage::helper(‘sales’)->__(‘ATTR_TITLE’), OFFSET, $this->y, ‘UTF-8′); if (!empty($settings[‘table_header’])) { $page->drawText(Mage::helper(‘sales’)-> (‘ATTR_TITLE’), OFFSET, $this->y, ‘UTF-8′); } There is no definitive solution as you need to change a few other details to limit column widths in other areas depending on where you are trying to put your values (ie. description is usually made narrower and forced to line-wrap).

Referenced from: http://www.magentocommerce.com/boards/viewthread/18142/P15/#t20162

  • this is for invoice printing right ? not for packinglip printing – Chamal Chamikara Jun 23 '15 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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