Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function insertTotals($page, $source)
- {
- $order = $source->getOrder();
- $totals = $this->_getTotalsList();
- $lineBlock = ['lines' => [], 'height' => 15];
- foreach ($totals as $total) {
- echo "<pre>";print_r($total->getData());// I get custom row values here
- $total->setOrder($order)->setSource($source);//But those get lost here
- <?xml version="1.0"?>
- <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/pdf_file.xsd">
- <totals>
- <total name="custfee">
- <title translate="true">Custom Fee</title>
- <font_size>7</font_size>
- <display_zero>true</display_zero>
- <sort_order>100</sort_order>
- </total>
- </totals>
- </config>
- $total->setOrder($order)->setSource($source);
- $total->getOrder()->getData(); // Order data
- $total->getSource()->getData(); // Invoice data
- //Get specific data from total object
- $total->getSourceField();
- $total->getSortOrder();
Add Comment
Please, Sign In to add comment