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


PHP Mage_Sales_Model_Order_Item::getOrderId方法代码示例

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


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

示例1: prepareCreditMemoItemData

 /**
  * Prepare item data to process refund
  * 
  * @param Varien_Object $dataObject
  * @param Mage_Sales_Model_Order_Item $orderItem
  * @return array
  */
 public function prepareCreditMemoItemData($dataObject, $orderItem)
 {
     $data = array();
     $itemId = $orderItem->getId();
     if (!$dataObject->getData("creditmemo/items/{$itemId}/qty")) {
         $itemId = $orderItem->getParentItemId() ? $orderItem->getParentItemId() : $orderItem->getId();
     }
     $data['back_to_stock'] = $dataObject->getData("creditmemo/items/{$itemId}/back_to_stock");
     $data['refund_qty'] = $dataObject->getData("creditmemo/items/{$itemId}/qty");
     $data['return_type'] = $dataObject->getData("creditmemo/select-warehouse-supplier/{$itemId}");
     $data['warehouse_id'] = $dataObject->getData("creditmemo/warehouse-select/{$itemId}");
     $data['warehouse_id'] = $data['warehouse_id'] ? $data['warehouse_id'] : $dataObject->getData('warehouse_id');
     if (!$data['warehouse_id']) {
         /* load warehouse_id from order_id */
         $data['warehouse_id'] = Mage::getModel('inventoryplus/warehouse')->getIdFromOrderId($orderItem->getOrderId());
         $dataObject->setData('warehouse_id', $data['warehouse_id']);
     }
     $data['warehouse'] = $this->_getWarehouse($data['warehouse_id']);
     $data['order_item'] = $orderItem;
     $data['order'] = $dataObject->getOrder();
     $data['creditmemo'] = $dataObject->getCreditmemoObject();
     $refundQtys = $this->_calculateRefundedQty($dataObject, $orderItem);
     $data['refund_qty'] = $refundQtys;
     /* get original warehouse of order */
     $orgWarehouse = $this->_getOrgWarehouse($orderItem->getOrderId());
     $data['org_warehouse'] = $orgWarehouse;
     /* prepare data */
     $this->_prepareWarehouseRefundData($data);
     $this->_prepareWarehouseOrderData($data);
     $this->_prepareWarehouseProductData($data);
     return $data;
 }
开发者ID:javik223,项目名称:Evron-Magento,代码行数:39,代码来源:Refund.php

示例2: sync

 /**
  * Sync the given order item to Klevu. Returns true on successful sync and
  * the error message otherwise.
  *
  * @param Mage_Sales_Model_Order_Item $item
  *
  * @return bool|string
  */
 protected function sync($item)
 {
     if (!$this->getApiKey($item->getStoreId())) {
         return "Klevu Search is not configured for this store.";
     }
     $parent = null;
     if ($item->getParentItemId()) {
         $parent = Mage::getModel("sales/order_item")->load($item->getParentItemId());
     }
     $response = Mage::getModel("klevu_search/api_action_producttracking")->execute(array("klevu_apiKey" => $this->getApiKey($item->getStoreId()), "klevu_type" => "checkout", "klevu_productId" => Mage::helper("klevu_search")->getKlevuProductId($item->getProductId(), $parent ? $parent->getProductId() : 0), "klevu_unit" => $item->getQtyOrdered() ? $item->getQtyOrdered() : ($parent ? $parent->getQtyOrdered() : null), "klevu_salePrice" => $item->getPriceInclTax() ? $item->getPriceInclTax() : ($parent ? $parent->getPriceInclTax() : null), "klevu_currency" => $this->getStoreCurrency($item->getStoreId()), "klevu_shopperIP" => $this->getOrderIP($item->getOrderId())));
     if ($response->isSuccessful()) {
         return true;
     } else {
         return $response->getMessage();
     }
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:24,代码来源:Sync.php


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