-
- jklina

-
Total Posts: 69
Joined: 2008-06-12
Philadelphia PA
|
Okay, so in order to modify the lines on the invoice so that the unit price would show up, I went into app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php and added the bit between “//Added Unit Price” and “Get Row Total” in the following:
/* in case Product SKU is longer than 36 chars - it is written in a few lines */ foreach (Mage::helper('core/string')->str_split($item->getSku(), 25) as $key => $part) { $page->drawText($part, 380, $pdf->y-$shift[2], 'UTF-8'); if ($key > 0) { $shift[2] += 10; } } //Added unit price $font = $this->_setFontBold(); $price = $order->formatPriceTxt($item->getOrderItem()->getOriginalPrice());
$page->drawText($price, 490-$pdf->widthForStringUsingFontSize($price, $font, 7), $pdf->y, 'UTF-8'); //$pdf->y -= max($shift)+10;
//Get Row Total $font = $this->_setFontBold(); $row_total = $order->formatPriceTxt($item->getRowTotal());
$page->drawText($row_total, 565-$pdf->widthForStringUsingFontSize($row_total, $font, 7), $pdf->y, 'UTF-8'); $pdf->y -= max($shift)+10;
I still don’t have a clear picture in my head how the class system is laid out, so if anyone can think of a more direct method to access unit price, please post it up.
Now to figure out how to add total weight....
|