Skip to content
This repository has been archived by the owner on Aug 1, 2018. It is now read-only.

Commit

Permalink
FIX email totals display
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix128 committed Sep 12, 2017
1 parent be0548b commit 524c11b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 16 deletions.
30 changes: 15 additions & 15 deletions Block/Info/CashOnDelivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ class CashOnDelivery extends Info
{
protected function _prepareSpecificInformation($transport = null)
{
if (is_null($this->_paymentSpecificInformation)) {
$transport = parent::_prepareSpecificInformation($transport);
$data = [];

/** @var Order $order */
$order = $this->getInfo()->getOrder();

$taxes = $order->getMspCodTaxAmount();
$amount = $order->getMspCodAmount() - $taxes;

$data[(string) __("Cash On Delivery Amount")] = $order->getOrderCurrency()->formatPrecision($amount, 2, [], false);
$data[(string) __("Cash On Delivery Tax")] = $order->getOrderCurrency()->formatPrecision($taxes, 2, [], false);

$this->_paymentSpecificInformation = $transport->setData(array_merge($data, $transport->getData()));
}
// if (is_null($this->_paymentSpecificInformation)) {
// $transport = parent::_prepareSpecificInformation($transport);
// $data = [];
//
// /** @var Order $order */
// $order = $this->getInfo()->getOrder();
//
// $taxes = $order->getMspCodTaxAmount();
// $amount = $order->getMspCodAmount() - $taxes;
//
// $data[(string) __("Cash On Delivery Amount")] = $order->getOrderCurrency()->formatPrecision($amount, 2, [], false);
// $data[(string) __("Cash On Delivery Tax")] = $order->getOrderCurrency()->formatPrecision($taxes, 2, [], false);
//
// $this->_paymentSpecificInformation = $transport->setData(array_merge($data, $transport->getData()));
// }

return $this->_paymentSpecificInformation;
}
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MSP_CashOnDelivery" setup_version="1.2.3">
<module name="MSP_CashOnDelivery" setup_version="1.2.4">
<sequence>
<module name="Magento_Sales" />
<module name="Magento_Payment" />
Expand Down
28 changes: 28 additions & 0 deletions view/frontend/layout/sales_email_order_items.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<!--
/**
* IDEALIAGroup srl
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category MSP
* @package MSP_CashOnDelivery
* @copyright Copyright (c) 2016 IDEALIAGroup srl (http://www.idealiagroup.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="order_totals">
<block class="MSP\CashOnDelivery\Block\Sales\Cashondelivery" name="msp_cashondelivery"/>
</referenceContainer>
</body>
</page>

0 comments on commit 524c11b

Please sign in to comment.