本文整理汇总了PHP中Mage_Sales_Model_Quote::getStoreToQuoteRate方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote::getStoreToQuoteRate方法的具体用法?PHP Mage_Sales_Model_Quote::getStoreToQuoteRate怎么用?PHP Mage_Sales_Model_Quote::getStoreToQuoteRate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote::getStoreToQuoteRate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toOrder
/**
* Convert quote model to order model
*
* @param Mage_Sales_Model_Quote $quote
* @return Mage_Sales_Model_Order
*/
public function toOrder(Mage_Sales_Model_Quote $quote, $order = null)
{
if (!$order instanceof Mage_Sales_Model_Order) {
$order = Mage::getModel('sales/order');
}
/* @var $order Mage_Sales_Model_Order */
$order->setStoreId($quote->getStoreId())->setQuoteId($quote->getId())->setRemoteIp($quote->getRemoteIp())->setCustomerId($quote->getCustomerId())->setCustomerEmail($quote->getCustomerEmail())->setCustomerFirstname($quote->getCustomerFirstname())->setCustomerLastname($quote->getCustomerLastname())->setCustomerGroupId($quote->getCustomerGroupId())->setCustomerTaxClassId($quote->getCustomerTaxClassId())->setCustomerNote($quote->getCustomerNote())->setCustomerNoteNotify($quote->getCustomerNoteNotify())->setCustomerIsGuest($quote->getCustomerIsGuest())->setBaseCurrencyCode($quote->getBaseCurrencyCode())->setStoreCurrencyCode($quote->getStoreCurrencyCode())->setOrderCurrencyCode($quote->getQuoteCurrencyCode())->setStoreToBaseRate($quote->getStoreToBaseRate())->setStoreToOrderRate($quote->getStoreToQuoteRate())->setCouponCode($quote->getCouponCode())->setGiftcertCode($quote->getGiftcertCode())->setIsVirtual($quote->getIsVirtual())->setIsMultiPayment($quote->getIsMultiPayment())->setAppliedRuleIds($quote->getAppliedRuleIds());
Mage::dispatchEvent('sales_convert_quote_to_order', array('order' => $order, 'quote' => $quote));
return $order;
}
示例2: _reCalculateToStoreCurrency
/**
* Recalculate amount to store currency
*
* @param float $amount
* @param Mage_Sales_Model_Quote $quote
* @return float
*/
protected function _reCalculateToStoreCurrency($amount, $quote)
{
if ($quote->getQuoteCurrencyCode() != $quote->getBaseCurrencyCode()) {
$amount = $amount * $quote->getStoreToQuoteRate();
$amount = Mage::app()->getStore()->roundPrice($amount);
}
return $amount;
}
示例3: getCurrencyRate
/**
* Fetches the current store's currency or the one from the quote model.
* @param Mage_Sales_Model_Quote $quote [also accepts order model]
*/
public function getCurrencyRate($quote = null)
{
if ($quote->getStoreToQuoteRate() && $quote) {
$c = round($quote->getStoreToQuoteRate(), 4);
} else {
if ($quote) {
$store = $quote->getStore() ? $quote->getStore() : Mage::app()->getStore();
} else {
$store = Mage::app()->getStore();
}
$baseCurrency = $store->getBaseCurrency();
if ($quote) {
$quoteCurrency = $quote->hasForcedCurrency() ? $quote->getForcedCurrency() : $store->getCurrentCurrency();
} else {
$quoteCurrency = $store->getCurrentCurrency();
}
$c = $baseCurrency->getRate($quoteCurrency);
}
return $c;
}