我尝试在发票上获得产品属性值,但我在堆栈上找到的所有内容都没有给出结果(getdata,getattribute,getressouce ......)
下面是该文件的摘录,我想替换最后一行" getname"通过getattribute
非常感谢
$order = $this->getOrder();
$item = $this->getItem();
$pdf = $this->getPdf();
$page = $this->getPage();
//$lines = array();
//if not only checking the height - let's check and set up page and background if needed
if (!$returnHeight)
{
$blockHeight = $this->draw(true);
if ($pdf->y - $blockHeight < 12)
{
$page = $pdf->newPage(array('table_header' => true));
$this->setPage($page);
}
if ($pdf->currentItemWithBg)
{
$page -> setFillColor(new Zend_Pdf_Color_Html('#' . $pdf -> params['lightBg']));
$page -> drawRectangle(18, $pdf -> y, $page->getWidth() - 18, $pdf -> y - $blockHeight, $fillType = Zend_Pdf_Page::SHAPE_DRAW_FILL);
}
}
//get price and subtotal values
$prices = $this->getItemPricesForDisplay();
$topOffset = 10;
//if there are labels leave more space at the top
if (count($prices) > 0 && !empty($prices[0]['label']))
$topOffset = 16;
//slice product name into chunks
$font = $pdf->_setFontLight($page, 9);
$nameParts = $commonHelper->sliceStringByPoints($item->getName(), 191, $font, 9);