Files
2026-09-15 10:26:34 +08:00

24 lines
782 B
PHP

<?php
namespace Stemcell\Sales\Block\Order\Email;
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);
}
}