本文整理汇总了PHP中Magento\Sales\Model\Order::getBaseDiscountAmount方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getBaseDiscountAmount方法的具体用法?PHP Order::getBaseDiscountAmount怎么用?PHP Order::getBaseDiscountAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Sales\Model\Order
的用法示例。
在下文中一共展示了Order::getBaseDiscountAmount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNonTaxableAmount
/**
* Get payment amount data with excluded tax
* @param \Magento\Sales\Model\Order $order
* @return array
*/
private function getNonTaxableAmount(Order $order)
{
return ['subtotal' => $this->_formatPrice($order->getBaseSubtotal()), 'total' => $this->_formatPrice($order->getPayment()->getBaseAmountAuthorized()), 'tax' => $this->_formatPrice($order->getBaseTaxAmount()), 'shipping' => $this->_formatPrice($order->getBaseShippingAmount()), 'discount' => $this->_formatPrice(abs($order->getBaseDiscountAmount()))];
}
示例2: getNonTaxableAmount
/**
* Get payment amount data with excluded tax
* @param \Magento\Sales\Model\Order $order
* @return array
*/
private function getNonTaxableAmount(Order $order)
{
// PayPal denied transaction with 0 amount
$subtotal = $order->getBaseSubtotal() ?: $order->getPayment()->getBaseAmountAuthorized();
return ['subtotal' => $this->formatPrice($subtotal), 'total' => $this->formatPrice($order->getPayment()->getBaseAmountAuthorized()), 'tax' => $this->formatPrice($order->getBaseTaxAmount()), 'shipping' => $this->formatPrice($order->getBaseShippingAmount()), 'discount' => $this->formatPrice(abs($order->getBaseDiscountAmount()))];
}
示例3: getTotalAmount
/**
* Repeat sql formula from \Magento\SalesRule\Model\Resource\Report\Rule\Createdat::_aggregateByOrder
*
* @param \Magento\Sales\Model\Order $order
* @return float
*/
private function getTotalAmount(\Magento\Sales\Model\Order $order)
{
return ($order->getBaseSubtotal() - $order->getBaseSubtotalCanceled() - (abs($order->getBaseDiscountAmount()) - abs($order->getBaseDiscountCanceled())) + ($order->getBaseTaxAmount() - $order->getBaseTaxCanceled())) * $order->getBaseToGlobalRate();
}
示例4: getBaseDiscountAmount
/**
* {@inheritdoc}
*/
public function getBaseDiscountAmount()
{
return $this->_salesModel->getBaseDiscountAmount();
}