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


PHP Mage_Sales_Model_Quote::getOrder方法代码示例

本文整理汇总了PHP中Mage_Sales_Model_Quote::getOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote::getOrder方法的具体用法?PHP Mage_Sales_Model_Quote::getOrder怎么用?PHP Mage_Sales_Model_Quote::getOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Sales_Model_Quote的用法示例。


在下文中一共展示了Mage_Sales_Model_Quote::getOrder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPgAddress

 /**
  * Gets a PakjeGemak address for either a quote or an order object.
  *
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
  *
  * @return false|Mage_Sales_Model_Order_Address|Mage_Sales_Model_Quote_Address|TIG_MyParcel2014_Model_Shipment
  */
 public function getPgAddress($object)
 {
     /**
      * Get all addresses for the specified object.
      */
     if ($object instanceof Mage_Sales_Model_Quote) {
         $addressCollection = $object->getAllAddresses();
     } elseif ($object instanceof Mage_Sales_Model_Order) {
         $addressCollection = $object->getAddressesCollection();
     } elseif ($object instanceof TIG_MyParcel2014_Model_Shipment) {
         $order = $object->getOrder();
         if (!$order) {
             return false;
         }
         $addressCollection = $order->getAddressesCollection();
     } else {
         return false;
     }
     /**
      * Go through each address and check if it's a PakjeGemak address.
      *
      * @var Mage_Sales_Model_Quote_Address|Mage_Sales_Model_Order_Address $address
      */
     $pgAddress = false;
     foreach ($addressCollection as $address) {
         if ($address->getAddressType() == self::PG_ADDRESS_TYPE) {
             $pgAddress = $address;
             break;
         }
     }
     /**
      * Return the PakjeGemak address or false if none was found.
      */
     return $pgAddress;
 }
开发者ID:myparcelnl,项目名称:magento1,代码行数:42,代码来源:Data.php

示例2: isObjectActionable

 /**
  * Determines if the object (quote, invoice, or credit memo) should use AvaTax services
  *
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
  * @param Mage_Sales_Model_Quote_Address $shippingAddress
  * @return bool
  */
 public function isObjectActionable($object, $shippingAddress = null)
 {
     $storeId = $object->getStore()->getId();
     //is action enabled?
     $action = $object->getOrder() ? OnePica_AvaTax_Model_Config::ACTION_CALC_SUBMIT : OnePica_AvaTax_Model_Config::ACTION_CALC;
     if (Mage::getStoreConfig('tax/avatax/action', $storeId) < $action) {
         return false;
     }
     if (!$shippingAddress) {
         $shippingAddress = $object->getShippingAddress();
     }
     if (!$shippingAddress) {
         $shippingAddress = $object->getBillingAddress();
     }
     //is the region filtered?
     if (!$this->isAddressActionable($shippingAddress, $storeId, OnePica_AvaTax_Model_Config::REGIONFILTER_TAX)) {
         return false;
     }
     return true;
 }
开发者ID:shabirm,项目名称:avatax,代码行数:27,代码来源:Data.php

示例3: 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;
 }
开发者ID:ratepay,项目名称:magento-module,代码行数:47,代码来源:Mapping.php


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