本文整理汇总了PHP中Mage_Sales_Model_Order_Invoice::getQuoteCurrencyCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Invoice::getQuoteCurrencyCode方法的具体用法?PHP Mage_Sales_Model_Order_Invoice::getQuoteCurrencyCode怎么用?PHP Mage_Sales_Model_Order_Invoice::getQuoteCurrencyCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order_Invoice
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order_Invoice::getQuoteCurrencyCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCurrency
/**
* Returns the currency compliant to ISO 4217 (3 char code)
* @return string 3 Character long currency code
*
* @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order|Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
* @return string
*/
public function getCurrency($object)
{
$currency = $object->getBaseCurrencyCode();
if (!Mage::helper('paymill/optionHelper')->isBaseCurrency()) {
if ($object instanceof Mage_Sales_Model_Quote) {
$currency = $object->getQuoteCurrencyCode();
} else {
$currency = $object->getOrderCurrencyCode();
}
}
return $currency;
}
示例2: getRequestBasket
/**
* Gets all needed Informations for shopping-basket Block of the Request
*
* @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order|Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
* @param float $amount
* @param array $articleList
* @return array
*/
public function getRequestBasket($object, $amount = '', $articleList = '')
{
$basket = array();
if ($object instanceof Mage_Sales_Model_Order) {
$basket['currency'] = $object->getOrderCurrencyCode();
} else {
if ($object instanceof Mage_Sales_Model_Quote) {
$basket['currency'] = $object->getQuoteCurrencyCode();
} else {
$basket['currency'] = $object->getOrder()->getOrderCurrencyCode();
}
}
if ($articleList != '') {
$basket['items'] = $articleList;
} else {
$basket['items'] = $this->getArticles($object);
}
// If no positiv item is remained in basket clear basket
if (!$this->_anyPositiveItems($basket['items'])) {
$basket['items'] = array();
}
if (is_numeric($amount)) {
$basket['amount'] = $amount;
} else {
if ($object->getGrandTotal() > 0) {
$basket['amount'] = $object->getGrandTotal();
} elseif (count($basket['items']) == 0) {
$basket['amount'] = 0;
} else {
$basket['amount'] = $this->getAmountByItems($basket['items']);
}
}
// Ensure that the basket amount is never less than zero
// In certain cases (i.e. in case of maloperation) the amount can become < 0
if ($basket['amount'] < 0) {
$basket['amount'] = 0;
}
return $basket;
}