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


PHP Mage_Sales_Model_Order_Item::getOrder方法代码示例

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


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

示例1: _loadDefaultAddressForItem

 /**
  * Get a default address for an item if one exists. For virtual items,
  * the default address will be the billing address of the order the item
  * belongs to. For non-virtual items, the default address will be the
  * primary shipping address of the order the item belongs to. If the
  * appropriate default address for the item does not exits, no address
  * will be returned.
  *
  * @param Mage_Sales_Model_Order_Item
  * @return Mage_Sales_Model_Order_Address|null
  */
 protected function _loadDefaultAddressForItem(Mage_Sales_Model_Order_Item $item)
 {
     $order = $item->getOrder();
     if (!$order) {
         return null;
     }
     $defaultAddress = $item->getIsVirtual() ? $order->getBillingAddress() : $order->getShippingAddress();
     // If the appropriate default address did not exist in the order, false
     // will have been returned. In such cases, return null to indicate that
     // no such address exists.
     return $defaultAddress ?: null;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:23,代码来源:Factory.php

示例2: itemToQuoteItem

 /**
  * Retrieve
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @return unknown
  */
 public function itemToQuoteItem(Mage_Sales_Model_Order_Item $item)
 {
     $quoteItem = Mage::getModel('sales/quote_item')->setStoreId($item->getOrder()->getStoreId())->setQuoteItemId($item->getId())->setProductId($item->getProductId())->setParentProductId($item->getParentProductId());
     Mage::helper('core')->copyFieldset('sales_convert_order_item', 'to_quote_item', $item, $quoteItem);
     return $quoteItem;
 }
开发者ID:quyip8818,项目名称:Mag,代码行数:12,代码来源:Order.php

示例3: itemToQuoteItem

 /**
  * Retrieve
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @return unknown
  */
 public function itemToQuoteItem(Mage_Sales_Model_Order_Item $item)
 {
     $quoteItem = AO::getModel('sales/quote_item')->setStoreId($item->getOrder()->getStoreId())->setQuoteItemId($item->getId())->setProductId($item->getProductId())->setParentProductId($item->getParentProductId());
     AO::helper('core')->copyFieldset('sales_convert_order_item', 'to_quote_item', $item, $quoteItem);
     //            ->setSku($item->getSku())
     //            ->setName($item->getName())
     //            ->setDescription($item->getDescription())
     //            ->setWeight($item->getWeight())
     //            ->setCustomPrice($item->getPrice())
     //            ->setDiscountPercent($item->getDiscountPercent())
     //            ->setDiscountAmount($item->getDiscountAmount())
     //            ->setTaxPercent($item->getTaxPercent())
     //            ->setTaxAmount($item->getTaxAmount())
     //            ->setRowWeight($item->getRowWeight())
     //            ->setRowTotal($item->getRowTotal())
     //            ->setAppliedRuleIds($item->getAppliedRuleIds())
     //
     //            ->setBaseDiscountAmount($item->getBaseDiscountAmount())
     //            ->setBaseTaxAmount($item->getBaseTaxAmount())
     //            ->setBaseRowTotal($item->getBaseRowTotal())
     //            ;
     return $quoteItem;
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:29,代码来源:Convert_Order.php

示例4: getItemFinalPriceInclTax

 /**
  * Get the final price in base currency for an ordered item including
  * taxes as discounts.
  *
  * @param Mage_Sales_Model_Order_Item $item the item model.
  *
  * @return float
  */
 public function getItemFinalPriceInclTax(Mage_Sales_Model_Order_Item $item)
 {
     $quantity = (double) $item->getQtyOrdered();
     $basePrice = $item->getBaseRowTotal() + $item->getBaseTaxAmount() + $item->getBaseHiddenTaxAmount() - $item->getBaseDiscountAmount();
     $orderCurrencyCode = $item->getOrder()->getOrderCurrencyCode();
     $baseCurrencyCode = $item->getOrder()->getBaseCurrencyCode();
     if ($orderCurrencyCode != $baseCurrencyCode) {
         $priceInOrderCurrency = Mage::helper('directory')->currencyConvert($basePrice, $baseCurrencyCode, $orderCurrencyCode);
     } else {
         $priceInOrderCurrency = $basePrice;
     }
     if ($quantity > 1) {
         $priceInOrderCurrency = round($priceInOrderCurrency / $quantity, 2);
     }
     return $priceInOrderCurrency;
 }
开发者ID:nosto,项目名称:nosto-magento-nodeps,代码行数:24,代码来源:Price.php

示例5: _createOrderItemStatus

 /**
  * Creates OCL OrderStatus record
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @return string
  */
 protected function _createOrderItemStatus(Mage_Sales_Model_Order_Item $item)
 {
     switch ($item->getStatusId()) {
         case Mage_Sales_Model_Order_Item::STATUS_SHIPPED:
             return self::STATUS_SHIPPED;
         case Mage_Sales_Model_Order_Item::STATUS_BACKORDERED:
             return self::STATUS_BACKORDERED;
         case Mage_Sales_Model_Order_Item::STATUS_CANCELED:
             return self::STATUS_CANCELLED;
         case Mage_Sales_Model_Order_Item::STATUS_PARTIAL:
             return self::STATUS_PARTIALLY_SHIPPED;
         case Mage_Sales_Model_Order_Item::STATUS_REFUNDED:
         case Mage_Sales_Model_Order_Item::STATUS_RETURNED:
             return self::STATUS_PROCESSING_RETURN;
     }
     $orderState = $item->getOrder()->getState();
     switch ($orderState) {
         case Mage_Sales_Model_Order::STATE_NEW:
             return self::STATUS_NEW;
         case Mage_Sales_Model_Order::STATE_HOLDED:
             return self::STATUS_ON_HOLD;
         case Mage_Sales_Model_Order::STATE_COMPLETE:
         case Mage_Sales_Model_Order::STATE_CLOSED:
             return self::STATUS_COMPLETED;
     }
     if ($orderState == Mage_Sales_Model_Order::STATE_PROCESSING && $item->getStatus() == Mage_Sales_Model_Order_Item::STATUS_INVOICED) {
         return $item->getIsVirtual() ? self::STATUS_PAID : self::STATUS_READY_TO_SHIP;
     }
     return self::STATUS_NEW;
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:36,代码来源:Order.php

示例6: getDetailsForOrderItem

 /**
  * Get item details for the given order item.
  * returns null if the item was excluded from the request or if
  * there was an error in the sdk
  *
  * @param  Mage_Sales_Model_Order_Item
  * @return EbayEnterprise_Inventory_Model_Details_Item|null
  */
 public function getDetailsForOrderItem(Mage_Sales_Model_Order_Item $item)
 {
     try {
         $result = $this->factory->createDetailsModel()->fetch($item->getOrder()->getQuote());
         return !is_null($result) ? $result->lookupDetailsByItemId($item->getQuoteItemId()) : $result;
     } catch (EbayEnterprise_Inventory_Exception_Details_Operation_Exception $e) {
         return null;
     }
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:17,代码来源:Service.php

示例7: _logInOrderHistory

 /**
  * @param Mage_Sales_Model_Order_Item $orderItem
  * @return bool
  */
 private function _logInOrderHistory(Mage_Sales_Model_Order_Item $orderItem)
 {
     // Isolate exceptions.
     try {
         $downloadableHelper = Mage::helper('ecodes/downloadable');
         $orderItem->getOrder()->addStatusHistoryComment($downloadableHelper->generateSerialsAssignedHistoryComment($this->getInfo('serials_added'), $this->getInfo('num_serials_not_assigned')))->setIsVisibleOnFront(false)->setIsCustomerNotified(false)->save();
         return true;
     } catch (Exception $e) {
         Mage::logException($e);
         $this->addError($e->getMessage());
     }
 }
开发者ID:ankita-parashar,项目名称:magento,代码行数:16,代码来源:ICC_Ecodes_Model_Mysql4_Downloadable_Collection.php

示例8: loadData

 /**
  * Loads the item info from the Magento order item model.
  *
  * @param Mage_Sales_Model_Order_Item $item the item model.
  */
 public function loadData(Mage_Sales_Model_Order_Item $item)
 {
     $order = $item->getOrder();
     $this->_productId = (int) $this->fetchProductId($item);
     $this->_quantity = (int) $item->getQtyOrdered();
     $this->_name = $this->fetchProductName($item);
     $this->_unitPrice = $item->getPriceInclTax();
     $this->_currencyCode = strtoupper($order->getOrderCurrencyCode());
 }
开发者ID:ngagestudios,项目名称:nosto-magento-extension,代码行数:14,代码来源:Item.php

示例9: getFrontendProductPrice

 /**
  * @param Mage_Sales_Model_Order_Item $orderItem
  *
  * @return string
  */
 public function getFrontendProductPrice(Mage_Sales_Model_Order_Item $orderItem)
 {
     $itemPrice = $orderItem->getPrice();
     if ($orderItem->getParentItemId()) {
         $parentItem = Mage::getModel('sales/order_item')->load($orderItem->getParentItemId());
         if ($parentItem->getProductType() != 'bundle') {
             $itemPrice = $parentItem->getPrice();
         }
     }
     return $orderItem->getOrder()->getOrderCurrency()->format($itemPrice);
 }
开发者ID:protechhelp,项目名称:gamamba,代码行数:16,代码来源:CustomerOrders.php


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