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


PHP Mage_Sales_Model_Order_Item::getParentItem方法代码示例

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


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

示例1: addOrderItem

 /**
  * Convert order item to quote item
  *
  * @param Mage_Sales_Model_Order_Item $orderItem
  * @param mixed $qtyFlag if is null set product qty like in order
  * @return Mage_Checkout_Model_Cart
  */
 public function addOrderItem($orderItem, $qtyFlag = null)
 {
     /* @var $orderItem Mage_Sales_Model_Order_Item */
     if (is_null($orderItem->getParentItem())) {
         $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($orderItem->getProductId());
         if (!$product->getId()) {
             return $this;
         }
         $info = $orderItem->getProductOptionByCode('info_buyRequest');
         $info = new Varien_Object($info);
         if (is_null($qtyFlag)) {
             $info->setQty($orderItem->getQtyOrdered());
         } else {
             $info->setQty(1);
         }
         $this->addProduct($product, $info);
     }
     return $this;
 }
开发者ID:vuhung,项目名称:Magento-Rack-Ketai,代码行数:26,代码来源:Cart.php

示例2: _needToAddDummyForShipment

 /**
  * Decides if we need to create dummy shipment item or not
  * for eaxample we don't need create dummy parent if all
  * children are not in process
  *
  * @deprecated after 1.4, Mage_Sales_Model_Service_Order used
  * @param Mage_Sales_Model_Order_Item $item
  * @param array $qtys
  * @return bool
  */
 protected function _needToAddDummyForShipment($item, $qtys)
 {
     if ($item->getHasChildren()) {
         foreach ($item->getChildrenItems() as $child) {
             if ($child->getIsVirtual()) {
                 continue;
             }
             if (isset($qtys[$child->getId()]) && $qtys[$child->getId()] > 0) {
                 return true;
             }
         }
         if ($item->isShipSeparately()) {
             return true;
         }
         return false;
     } else {
         if ($item->getParentItem()) {
             if ($item->getIsVirtual()) {
                 return false;
             }
             if (isset($qtys[$item->getParentItem()->getId()]) && $qtys[$item->getParentItem()->getId()] > 0) {
                 return true;
             }
             return false;
         }
     }
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:37,代码来源:InvoiceController.php

示例3: _needToAddDummy

 /**
  * Decides if we need to create dummy shipment item or not
  * for eaxample we don't need create dummy parent if all
  * children are not in process
  *
  * @deprecated after 1.4, Mage_Sales_Model_Service_Order used
  * @param Mage_Sales_Model_Order_Item $item
  * @param array $qtys
  * @return bool
  */
 protected function _needToAddDummy($item, $qtys)
 {
     if ($item->getHasChildren()) {
         foreach ($item->getChildrenItems() as $child) {
             if ($child->getIsVirtual()) {
                 continue;
             }
             if (isset($qtys[$child->getId()]) && $qtys[$child->getId()] > 0 || !isset($qtys[$child->getId()]) && $child->getQtyToShip()) {
                 return true;
             }
         }
         return false;
     } else {
         if ($item->getParentItem()) {
             if ($item->getIsVirtual()) {
                 return false;
             }
             if (isset($qtys[$item->getParentItem()->getId()]) && $qtys[$item->getParentItem()->getId()] > 0 || !isset($qtys[$item->getParentItem()->getId()]) && $item->getParentItem()->getQtyToShip()) {
                 return true;
             }
             return false;
         }
     }
 }
开发者ID:votanlean,项目名称:Magento-Pruebas,代码行数:34,代码来源:ShipmentController.php

示例4: _needToAddDummy

 /**
  * Decides if we need to create dummy invoice item or not
  * for eaxample we don't need create dummy parent if all
  * children are not in process
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @param array $qtys
  * @return bool
  */
 protected function _needToAddDummy($item, $qtys = array())
 {
     if ($item->getHasChildren()) {
         foreach ($item->getChildrenItems() as $child) {
             if (empty($qtys)) {
                 if ($child->getQtyToInvoice() > 0) {
                     return true;
                 }
             } else {
                 if (isset($qtys[$child->getId()]) && $qtys[$child->getId()] > 0) {
                     return true;
                 }
             }
         }
         return false;
     } else {
         if ($item->getParentItem()) {
             if (empty($qtys)) {
                 if ($item->getParentItem()->getQtyToInvoice() > 0) {
                     return true;
                 }
             } else {
                 if (isset($qtys[$child->getId()]) && $qtys[$child->getId()] > 0) {
                     return true;
                 }
             }
             return false;
         }
     }
 }
开发者ID:HelioFreitas,项目名称:magento-pt_br,代码行数:39,代码来源:Order.php

示例5: _needToAddDummy

 /**
  * Decides if we need to create dummy invoice item or not
  * for eaxample we don't need create dummy parent if all
  * children are not in process
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @param array $qtys
  * @return bool
  */
 protected function _needToAddDummy($item, $qtys)
 {
     if ($item->getHasChildren()) {
         foreach ($item->getChildrenItems() as $child) {
             if (isset($qtys[$child->getId()]) && isset($qtys[$child->getId()]['qty']) && $qtys[$child->getId()]['qty'] > 0) {
                 return true;
             }
         }
         return false;
     } else {
         if ($item->getParentItem()) {
             if (isset($qtys[$item->getParentItem()->getId()]) && isset($qtys[$item->getParentItem()->getId()]['qty']) && $qtys[$item->getParentItem()->getId()]['qty'] > 0) {
                 return true;
             }
             return false;
         }
     }
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:27,代码来源:CreditmemoController.php

示例6: _canRefundItem

 /**
  * Check if order item can be refunded
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @param array $qtys
  * @param array $invoiceQtysRefundLimits
  * @return bool
  */
 protected function _canRefundItem($item, $qtys = array(), $invoiceQtysRefundLimits = array())
 {
     if ($item->isDummy()) {
         if ($item->getHasChildren()) {
             foreach ($item->getChildrenItems() as $child) {
                 if (empty($qtys)) {
                     if ($this->_canRefundNoDummyItem($child, $invoiceQtysRefundLimits)) {
                         return true;
                     }
                 } else {
                     if (isset($qtys[$child->getId()]) && $qtys[$child->getId()] > 0) {
                         return true;
                     }
                 }
             }
             return false;
         } else {
             if ($item->getParentItem()) {
                 $parent = $item->getParentItem();
                 if (empty($qtys)) {
                     return $this->_canRefundNoDummyItem($parent, $invoiceQtysRefundLimits);
                 } else {
                     return isset($qtys[$parent->getId()]) && $qtys[$parent->getId()] > 0;
                 }
             }
         }
     } else {
         return $this->_canRefundNoDummyItem($item, $invoiceQtysRefundLimits);
     }
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:38,代码来源:Order.php

示例7: _getOrderItemParent

 /**
  * Safe way to lookup parent order items.
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @return Mage_Sales_Model_Order_Item
  */
 protected function _getOrderItemParent(Mage_Sales_Model_Order_Item $item)
 {
     if ($item->getParentItem()) {
         return $item->getParentItem();
     }
     $parentItem = Mage::getModel('sales/order_item')->load($item->getParentItemId());
     $item->setParentItem($parentItem);
     return $parentItem;
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:15,代码来源:Export.php

示例8: _canRefundItem

 /**
  * Check if order item can be refunded
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @param array $qtys
  * @return bool
  */
 protected function _canRefundItem($item, $qtys = array())
 {
     if ($item->isDummy()) {
         if ($item->getHasChildren()) {
             foreach ($item->getChildrenItems() as $child) {
                 if (empty($qtys)) {
                     if ($child->getQtyToRefund() > 0) {
                         return true;
                     }
                 } else {
                     if (isset($qtys[$child->getId()]) && $qtys[$child->getId()] > 0) {
                         return true;
                     }
                 }
             }
             return false;
         } else {
             if ($item->getParentItem()) {
                 $parent = $item->getParentItem();
                 if (empty($qtys)) {
                     return $parent->getQtyToRefund() > 0;
                 } else {
                     return isset($qtys[$parent->getId()]) && $qtys[$parent->getId()] > 0;
                 }
             }
         }
     } else {
         return $item->getQtyToRefund() > 0;
     }
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:37,代码来源:Order.php

示例9: _filterInvoiceItem

 /**
  * @param Mage_Sales_Model_Order_Item $item
  * @param int                         $index
  *
  * @return Bronto_Common_Model_Email_Template_Filter
  */
 protected function _filterInvoiceItem($item, $index = null)
 {
     if ($item->getParentItem()) {
         return $this;
     }
     // Product Price Excluding Tax
     if (Mage::helper('tax')->displaySalesPriceExclTax($this->getStore()) || Mage::helper('tax')->displaySalesBothPrices($this->getStore())) {
         if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'email', $this->getStore())) {
             $this->setField("productPriceExclTax_{$index}", $this->formatPrice($item->getRowTotal() + $item->getWeeeTaxAppliedRowAmount() + $item->getWeeeTaxRowDisposition()));
         } else {
             $this->setField("productPriceExclTax_{$index}", $this->formatPrice($item->getRowTotal()));
         }
     }
     // Product Price Including Tax
     if (Mage::helper('tax')->displaySalesPriceInclTax($this->getStore()) || Mage::helper('tax')->displaySalesBothPrices($this->getStore())) {
         $_incl = Mage::helper('checkout')->getSubtotalInclTax($item);
         if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'email', $this->getStore())) {
             $this->setField("productPriceInclTax_{$index}", $this->formatPrice($_incl + $item->getWeeeTaxAppliedRowAmount()));
         } else {
             $this->setField("productPriceInclTax_{$index}", $this->formatPrice($_incl - $item->getWeeeTaxRowDisposition()));
         }
     }
     // Set Product Detail Fields
     $this->setField("productName_{$index}", $item->getName());
     $this->setField("productSku_{$index}", $item->getSku());
     $this->setField("productPrice_{$index}", $this->formatPrice($item->getPrice()));
     $this->setField("productTotal_{$index}", $this->formatPrice($item->getRowTotal()));
     $this->setField("productQty_{$index}", $item->getQtyOrdered() * 1);
     $this->setField("productUrl_{$index}", $this->_getOrderItemUrl($item));
     // Handle Gift Message Details
     if ($item->getGiftMessageId() && ($_giftMessage = Mage::helper('giftmessage/message')->getGiftMessage($item->getGiftMessageId()))) {
         $this->setField("giftMessage_{$index}", $_giftMessage->getMessage());
         $this->setField("giftMessageFrom_{$index}", $_giftMessage->getSender());
         $this->setField("giftMessageTo_{$index}", $_giftMessage->getRecipient());
     }
     /* @var $product Mage_Catalog_Model_Product */
     $product = $item->getProduct();
     if (!$product) {
         $product = Mage::getModel('bronto_common/product')->getProduct($item->getProductId(), $this->getStoreId());
     }
     $this->_filterProduct($product, $index);
     return $this;
 }
开发者ID:bevello,项目名称:bevello,代码行数:49,代码来源:Filter.php

示例10: _itemIsConfigurableChild

 /**
  * Check if the item is the child of a configurable product.
  *
  * @param Mage_Sales_Model_Order_Item
  * @return bool
  */
 protected function _itemIsConfigurableChild(Mage_Sales_Model_Order_Item $item)
 {
     $parentItem = $item->getParentItem();
     return $parentItem && $parentItem->getProductType() === Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:11,代码来源:Selection.php

示例11: getKeyItem

 /**
  * get the item to use when looking up a relationship.
  * return null if the item is not supposed to have a
  * relationship payload
  *
  * @return Mage_Sales_Model_Order_Item|null
  */
 protected function getKeyItem()
 {
     $keyItem = $this->item->getParentItem() ?: $this->item;
     return $keyItem->getProductType() === Mage_Catalog_Model_Product_Type::TYPE_BUNDLE ? $keyItem : null;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:12,代码来源:Relationships.php


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