本文整理匯總了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();
}