当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Sales_Model_Quote::getStoreToQuoteRate方法代码示例

本文整理汇总了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;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:16,代码来源:Quote.php

示例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;
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:15,代码来源:Abstract.php

示例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;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:24,代码来源:Price.php


注:本文中的Mage_Sales_Model_Quote::getStoreToQuoteRate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。