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


PHP Mage_Sales_Model_Order_Item::getQtyToRefund方法代码示例

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


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

示例1: _canRefundNoDummyItem

 /**
  * Check if no dummy order item can be refunded
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @param array $invoiceQtysRefundLimits
  * @return bool
  */
 protected function _canRefundNoDummyItem($item, $invoiceQtysRefundLimits = array())
 {
     if ($item->getQtyToRefund() < 0) {
         return false;
     }
     if (isset($invoiceQtysRefundLimits[$item->getId()])) {
         return $invoiceQtysRefundLimits[$item->getId()] > 0;
     }
     return true;
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:17,代码来源:Order.php

示例2: _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

示例3: returnOrderItem

 /**
  * Remove specific qty of order item from order
  *
  * @param Mage_Sales_Model_Order      $order
  * @param Mage_Sales_Model_Order_Item $orderItem
  * @param null                        $qtyToReturn
  * @return $this
  */
 public function returnOrderItem(Mage_Sales_Model_Order $order, Mage_Sales_Model_Order_Item $orderItem, $qtyToReturn = null)
 {
     if (is_null($qtyToReturn)) {
         $qtyToReturn = $orderItem->getQtyToRefund() + $orderItem->getQtyToCancel();
     }
     if ($qtyToReturn > 0 && $orderItem->getQtyToCancel() > 0) {
         $qtyToCancel = min($qtyToReturn, $orderItem->getQtyToCancel());
         $qtyToReturn -= $qtyToCancel;
         $this->cancelOrderItem($orderItem, $qtyToCancel);
     }
     if ($qtyToReturn > 0 && $orderItem->getQtyToRefund() > 0) {
         $creditMemo = $this->refundOrderItem($order, $orderItem, $qtyToReturn);
     }
     return $this;
 }
开发者ID:AleksNesh,项目名称:pandora,代码行数:23,代码来源:Edit.php

示例4: _refundItem

 /**
  * update quantity to refund
  * 
  * @param Mage_Sales_Model_Order_Item $item
  * @param array() $dataQty
  * @param int $keepQty
  * @return array() $dataQty
  */
 private function _refundItem($item, $dataQty, $keepQty = 0)
 {
     $refundQty = $item->getQtyToRefund() - $keepQty;
     if ($refundQty > 0) {
         // set quantity to refund
         $dataQty[$item->getId()] = $refundQty;
         // search child to by refund as well
         $childItems = $item->getChildrenItems();
         foreach ($childItems as $child) {
             $dataQty = $this->_refundItem($child, $dataQty, $keepQty);
         }
     }
     return $dataQty;
 }
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:22,代码来源:Sofortrechnung.php


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