28 lines
957 B
PHP
28 lines
957 B
PHP
<?php
|
|
|
|
namespace Stemcell\Sales\Block\Order\Email\Salesperson;
|
|
|
|
class Items extends \Magento\Sales\Block\Order\Email\Items
|
|
{
|
|
public function getPrice(\Magento\Sales\Model\Order\Item $item): string
|
|
{
|
|
// $discountPercent = $item->getData('customer_discount_percent')*1.0;
|
|
$price = $item->getPrice();
|
|
// $price = $discountPercent? $price*((100-$discountPercent)/100):$price;
|
|
return number_format($price, 2);
|
|
}
|
|
|
|
public function getRowTotal(\Magento\Sales\Model\Order\Item $item): string
|
|
{
|
|
$discountPercent = $item->getData('customer_discount_percent')*1.0;
|
|
$rowTotal = $item->getRowTotal();
|
|
$rowTotal = $discountPercent? $rowTotal*((100-$discountPercent)/100):$rowTotal;
|
|
return number_format($rowTotal, 2);
|
|
}
|
|
|
|
public function getSalespersonGrandTotal(\Magento\Sales\Model\Order $order): string
|
|
{
|
|
return '¥'.number_format($order->getGrandTotal(), 2);
|
|
}
|
|
}
|