本文整理汇总了PHP中Mage_Sales_Model_Order::getTotalDue方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order::getTotalDue方法的具体用法?PHP Mage_Sales_Model_Order::getTotalDue怎么用?PHP Mage_Sales_Model_Order::getTotalDue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order::getTotalDue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: crateFromOrder
public static function crateFromOrder(Mage_Sales_Model_Order $order)
{
$aOrder = new self();
$aOrder->id = $order->getIncrementId();
$aOrder->currency = $order->getOrderCurrencyCode();
$aOrder->total_amount = Aplazame_Sdk_Serializer_Decimal::fromFloat($order->getTotalDue());
$aOrder->articles = array_map(array('Aplazame_Aplazame_BusinessModel_Article', 'crateFromOrderItem'), $order->getAllVisibleItems());
if (($discounts = $order->getDiscountAmount()) !== null) {
$aOrder->discount = Aplazame_Sdk_Serializer_Decimal::fromFloat(-$discounts);
}
return $aOrder;
}
示例2: isOrderTotalCorrect
/**
* check if order total is correct
*
* @param ShopgateOrder $order
* @param Mage_Sales_Model_Order $oMageOrder
* @param string $message
*
* @return bool
*/
public function isOrderTotalCorrect(ShopgateOrder $order, Mage_Sales_Model_Order $oMageOrder, &$message = "")
{
$totalShopgate = $order->getAmountComplete();
$totalMagento = $oMageOrder->getTotalDue() + $oMageOrder->getTotalPaid();
ShopgateLogger::getInstance()->log("Total Shopgate: {$totalShopgate} {$order->getCurrency()} \n Total Magento: {$totalMagento} {$order->getCurrency()}", ShopgateLogger::LOGTYPE_DEBUG);
if (abs($totalShopgate - $totalMagento) > 0.02) {
$msg = "differing total order amounts:\n";
$msg .= "\tShopgate:\t{$totalShopgate} {$order->getCurrency()} \n";
$msg .= "\tMagento:\t{$totalMagento} {$oMageOrder->getOrderCurrencyCode()}\n";
$message = $msg;
return false;
}
return true;
}
示例3: createFromOrder
/**
* @param Mage_Sales_Model_Order $order
*
* @return array
*/
public static function createFromOrder(Mage_Sales_Model_Order $order)
{
$serialized = array('id' => $order->getIncrementId(), 'amount' => Aplazame_Sdk_Serializer_Decimal::fromFloat($order->getGrandTotal()), 'due' => Aplazame_Sdk_Serializer_Decimal::fromFloat($order->getTotalDue()), 'status' => $order->getStatus(), 'type' => $order->getPayment()->getMethodInstance()->getCode(), 'order_date' => date(DATE_ISO8601, strtotime($order->getCreatedAt())), 'currency' => $order->getOrderCurrencyCode(), 'billing' => Aplazame_Aplazame_BusinessModel_Address::createFromAddress($order->getBillingAddress()), 'shipping' => Aplazame_Aplazame_BusinessModel_ShippingInfo::createFromOrder($order));
return $serialized;
}
示例4: updatePaymentByOrder
/**
* @param Mage_Sales_Model_Order $order
*/
protected function updatePaymentByOrder(Mage_Sales_Model_Order $order)
{
// Set Amount Authorized
$this->getPayment()->setAmountAuthorized($order->getTotalDue());
$this->getPayment()->setBaseAmountAuthorized($order->getBaseTotalDue());
}
示例5: _updateOrderPayment
/**
* @param Mage_Sales_Model_Order $magentoOrder
* @param ShopgateOrder $shopgateOrder
*
* @return Mage_Sales_Model_Order
*/
protected function _updateOrderPayment($magentoOrder, $shopgateOrder)
{
if ($shopgateOrder->getUpdatePayment() && $magentoOrder->getTotalDue() > 0) {
$this->log("# Update payment", ShopgateLogger::LOGTYPE_DEBUG);
$magentoOrder = $this->_setOrderPayment($magentoOrder, $shopgateOrder);
$this->log("# Update payment successful", ShopgateLogger::LOGTYPE_DEBUG);
}
return $magentoOrder;
}