2017-06-12 12 views
0

私は請求書PDFに免責条項を追加しようとしています。 現在、テキストはSales/Model/Order/Pdf/Invoice.phpにハードコードされています。請求書にhtmlを追加するMagento

public function getDesclaimer($page) 
{ 
    $page->drawLine(25, $this->y, 570, $this->y); 
    $this->y -= 25; 
    $this->_setFontRegular($page, 12); 
    $page->drawText(Mage::helper('sales')->__('Declaration'), 35, $this->y-20, 'UTF-8'); 
    $this->_setFontRegular($page, 8); 
    $page->drawText(Mage::helper('sales')->__('The goods sold are intended for end user consumption and not for resale.'), 35, $this->y-50, 'UTF-8'); 
    $page->drawText(Mage::helper('sales')->__('The goods sold are intended for end user consumption and not for resale.'), 35, $this->y-60, 'UTF-8'); 
    $page->drawText(Mage::helper('sales')->__('of goods specified in this tax invoice is made by me/us and that the transaction of sale covered by this tax invoice has been effected by me/us'), 35, $this->y-70, 'UTF-8'); 
    $page->drawText(Mage::helper('sales')->__('and it shall be accounted for in the turnover of sales while filling of return and the due tax,if any payable on the sale has been paid or shall be paid.'), 35, $this->y-80, 'UTF-8'); 
    $page->drawText(Mage::helper('sales')->__('This is a computer generated invoice.'), 35, $this->y-100, 'UTF-8'); 
} 

これは機能します。いいえ私はmagentoの設定に設定を追加し、同じ機能の下でそれを呼び出します。

これは適切なテキストを表示しますが、HTMLは機能しません。

私はzendを入手したときにpdfはpdfのhtmlを許可しません。 TCPDFを使う必要があります。私もそれを試みたが、それは他のデータなしで全く新しいページを与えている。

答えて

0

コアファイルを編集しないでください。 モジュールを作成するは、を請求書pdf関数に上書きする必要があります。

このURLを使用すると、請求書のPDF機能を上書きできます。

http://inchoo.net/magento/how-to-add-custom-attribute-to-magentos-pdf-invoice/

上記のURLを試してみて、あなたの条件としてカスタマイズします。

関連する問題