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


PHP Mage_Sales_Model_Order::getQuote方法代码示例

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


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

示例1: getCustomerBalanceModelFromSalesEntity

 /**
  * Get customer balance model using sales entity
  *
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $salesEntity
  *
  * @return Enterprise_CustomerBalance_Model_Balance|bool
  */
 public function getCustomerBalanceModelFromSalesEntity($salesEntity)
 {
     if ($salesEntity instanceof Mage_Sales_Model_Order) {
         $customerId = $salesEntity->getCustomerId();
         $quote = $salesEntity->getQuote();
     } elseif ($salesEntity instanceof Mage_Sales_Model_Quote) {
         $customerId = $salesEntity->getCustomer()->getId();
         $quote = $salesEntity;
     } else {
         return false;
     }
     if (!$customerId) {
         return false;
     }
     $customerBalanceModel = Mage::getModel('enterprise_customerbalance/balance')->setCustomerId($customerId)->setWebsiteId(Mage::app()->getStore($salesEntity->getStoreId())->getWebsiteId())->loadByCustomer();
     if ($quote->getBaseCustomerBalanceVirtualAmount() > 0) {
         $customerBalanceModel->setAmount($customerBalanceModel->getAmount() + $quote->getBaseCustomerBalanceVirtualAmount());
     }
     return $customerBalanceModel;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:27,代码来源:Data.php

示例2: _getStoreIdByObject

 /**
  * Retrieve storeId from object
  *
  * @param OnePica_AvaTax_Model_Sales_Quote_Address|Mage_Sales_Model_Order $object
  * @return int
  */
 protected function _getStoreIdByObject($object)
 {
     if ($object instanceof OnePica_AvaTax_Model_Sales_Quote_Address) {
         return $object->getQuote()->getStoreId();
     }
     return $object->getStoreId();
 }
开发者ID:virtual97,项目名称:avatax,代码行数:13,代码来源:Abstract.php

示例3: getPrimaryShippingAddress

 /**
  * get shipping address with the highest subtotal amount.
  *
  * @param Mage_Sales_Model_Order
  * @return Mage_Sales_Model_Order_Address|null
  */
 protected function getPrimaryShippingAddress(Mage_Sales_Model_Order $order)
 {
     $collection = $order->getAddressesCollection();
     $address = $collection->getItemByColumnValue('quote_address_id', $this->getQuotePrimaryShippingAddressId($order->getQuote()));
     return $address;
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:12,代码来源:Ccpayment.php

示例4: buildPlanItemsForSubscription

 /**
  * @param Mage_Sales_Model_Order $order
  *
  * @return array
  */
 public function buildPlanItemsForSubscription($order)
 {
     $list = [];
     $orderItems = $order->getItemsCollection();
     $orderSubtotal = $order->getQuote()->getSubtotal();
     $orderDiscount = $order->getDiscountAmount() * -1;
     $discount = null;
     if (!empty($orderDiscount)) {
         $discountPercentage = $orderDiscount * 100 / $orderSubtotal;
         $discountPercentage = number_format(floor($discountPercentage * 100) / 100, 2);
         $discount = [['discount_type' => 'percentage', 'percentage' => $discountPercentage]];
     }
     foreach ($orderItems as $item) {
         $product = Mage::getModel('catalog/product')->load($item->getProductId());
         if ($product->getTypeID() !== 'subscription') {
             Mage::throwException("O produto {$item->getName()} não é uma assinatura.");
             return false;
         }
         $productVindiId = $this->findOrCreateProduct(array('sku' => $item->getSku(), 'name' => $item->getName()));
         for ($i = 1; $i <= $item->getQtyOrdered(); $i++) {
             $list[] = ['product_id' => $productVindiId, 'pricing_schema' => ['price' => $item->getPrice()], 'discounts' => $discount];
         }
     }
     // Create product for shipping
     $productVindiId = $this->findOrCreateProduct(array('sku' => 'frete', 'name' => 'Frete'));
     $list[] = ['product_id' => $productVindiId, 'pricing_schema' => ['price' => $order->getShippingAmount()]];
     return $list;
 }
开发者ID:edvanmacedo,项目名称:vindi-magento,代码行数:33,代码来源:Api.php

示例5: _getTaxClassId

 /**
  * Get tax class id
  *
  * @param OnePica_AvaTax_Model_Sales_Quote_Address|Mage_Sales_Model_Order $object
  * @return int
  */
 protected function _getTaxClassId($object)
 {
     if ($object instanceof OnePica_AvaTax_Model_Sales_Quote_Address) {
         return $object->getQuote()->getCustomerTaxClassId();
     }
     return Mage::getSingleton('customer/group')->load($object->getCustomerGroupId())->getTaxClassId();
 }
开发者ID:onepica,项目名称:avatax,代码行数:13,代码来源:Calculation.php


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