Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Ok, here is what I did. I put the following code - that I wrote:</p> <pre><code>/* Add Customer Type to Invoice */ $write = Mage::getSingleton('core/resource')-&gt;getConnection('core_write'); $readresult=$write-&gt;query("select customer_id from `sales_order` where increment_id = ".$order-&gt;getIncrementId()." limit 0,1;"); $row = $readresult-&gt;fetch(); $customerId = $row['customer_id']; $myRoleId = 1; if (!empty($customerId)) { $write = Mage::getSingleton('core/resource')-&gt;getConnection('core_write'); $readresult=$write-&gt;query("select group_id from `customer_entity` where entity_id = ".$customerId." limit 0,1;"); $row = $readresult-&gt;fetch(); $myRoleId = $row['group_id']; } switch ($myRoleId){ case 2: $groupTitle = 'Wholesaler Invoice'; break; case 3: $groupTitle = 'Retailer Invoice'; break; case 4: $groupTitle = 'Dealer Invoice'; break; default: $groupTitle = 'Customer Invoice'; break; } $page-&gt;drawText($groupTitle, 480, 780, 'UTF-8'); /* End add Customer Type */ </code></pre> <p>Immediately after this block of code that already existed:</p> <pre><code>/* Add head */ $this-&gt;insertOrder($page, $order, Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID, $order-&gt;getStoreId())); $page-&gt;setFillColor(new Zend_Pdf_Color_GrayScale(1)); $this-&gt;_setFontRegular($page); $page-&gt;drawText(Mage::helper('sales')-&gt;__('Invoice # ') . $invoice-&gt;getIncrementId(), 35, 780, 'UTF-8'); </code></pre> <p>In the app\code\local\Mage\Sales\Model\Order\Pdf\Invoice.php file</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload