Magento: Add customer group to pdf packing slip -
i trying add customer's group pdf packing slips. assuming should done in sales/model/order/pdf/abstract.php, put where?
thanks
ok, here did. put following code - wrote:
/* add customer type invoice */ $write = mage::getsingleton('core/resource')->getconnection('core_write'); $readresult=$write->query("select customer_id `sales_order` increment_id = ".$order->getincrementid()." limit 0,1;"); $row = $readresult->fetch(); $customerid = $row['customer_id']; $myroleid = 1; if (!empty($customerid)) { $write = mage::getsingleton('core/resource')->getconnection('core_write'); $readresult=$write->query("select group_id `customer_entity` entity_id = ".$customerid." limit 0,1;"); $row = $readresult->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->drawtext($grouptitle, 480, 780, 'utf-8'); /* end add customer type */
immediately after block of code existed:
/* add head */ $this->insertorder($page, $order, mage::getstoreconfigflag(self::xml_path_sales_pdf_invoice_put_order_id, $order->getstoreid())); $page->setfillcolor(new zend_pdf_color_grayscale(1)); $this->_setfontregular($page); $page->drawtext(mage::helper('sales')->__('invoice # ') . $invoice->getincrementid(), 35, 780, 'utf-8');
in app\code\local\mage\sales\model\order\pdf\invoice.php file
Comments
Post a Comment