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


PHP Mage_Sales_Model_Order_Item::getSku方法代码示例

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


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

示例1: getItemSku

 /**
  * Returns the sku of the given item dependant on the product type.
  *
  * @param Mage_Sales_Model_Order_Item $item The item to return info from
  * @return String The sku
  */
 protected function getItemSku($item)
 {
     if ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
         return $item->getProductOptionByCode('simple_sku');
     }
     return $item->getSku();
 }
开发者ID:rob3000,项目名称:fontis_australia,代码行数:13,代码来源:Abstract.php

示例2: getItemAllocationInformation

 /**
  * get allocation information for an item
  *
  * @param  Mage_Sales_Model_Order_Item
  * @return EbayEnterprise_Inventory_Model_Allocation|null
  */
 public function getItemAllocationInformation(Mage_Sales_Model_Order_Item $item)
 {
     $result = $this->getInventorySession()->getAllocationResult();
     if ($result) {
         return $result->lookupAllocationByItemId($item->getQuoteItemId());
     }
     $this->logger->debug('Unable to get allocation information for item {sku} id {item_id}', $this->logContext->getMetaData(__CLASS__, ['sku' => $item->getSku(), 'item_id' => $item->getQuoteItemId()]));
     return null;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:15,代码来源:Service.php

示例3: _getDupePosition

 /**
  * check if the current sku already exists in the params data if so return
  * the position it is found in
  * @param array $params the given array of keys needed to build the beacon URL querystring
  * @param Mage_Sales_Model_Order_Item $item
  * @return int the item position where dupe found otherwise zero
  */
 protected function _getDupePosition(array $params, Mage_Sales_Model_Order_Item $item)
 {
     $key = array_search($item->getSku(), $params, true);
     return $key !== false ? (int) str_replace(static::KEY_ITEM, '', $key) : 0;
 }
开发者ID:adamhobson,项目名称:magento-eems-affiliate,代码行数:12,代码来源:Beacon.php

示例4: getAdminProductSku

 /**
  * Retrieves RMA item sku for backend
  *
  * @param  Mage_Sales_Model_Order_Item $item
  * @return string
  */
 public function getAdminProductSku($item)
 {
     $name = $item->getSku();
     if ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
         $productOptions = $item->getProductOptions();
         return $productOptions['simple_sku'];
     }
     return $name;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:15,代码来源:Data.php

示例5: handleInsufficientStock

 /**
  * handle the case where there is not enough stock to allocate the
  * full amount requested
  *
  * @param EbayEnterprise_Inventory_Model_Allocation
  * @param Mage_Sales_Model_Order_Item
  * @throws EbayEnterprise_Inventory_Exception_Allocation_Availability_Exception
  */
 protected function handleInsufficientStock(Mage_Sales_Model_Order_Item $item)
 {
     $this->logger->debug('Unable to reserve desired quantity for item {sku}', $this->logContext->getMetaData(__CLASS__, ['sku' => $item->getSku()]));
     throw Mage::exception('EbayEnterprise_Inventory_Exception_Allocation_Availability', $this->invHelper->__(static::INSUFFICIENT_STOCK_MESSAGE));
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:13,代码来源:Allocation.php

示例6: 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->getStoreId())->setQuoteItemId($item->getId())->setProductId($item->getProductId())->setSuperProductId($item->getSuperProductId())->setParentProductId($item->getParentProductId())->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:arslbbt,项目名称:mangentovies,代码行数:11,代码来源:Order.php

示例7: _createSimpleOrderLineData

 /**
  * Returns SimpleOrderLineData record
  *
  * @param Mage_Sales_Model_Order_Item $item
  * @return array
  */
 protected function _createSimpleOrderLineData(Mage_Sales_Model_Order_Item $item)
 {
     /** @var $product Mage_Catalog_Model_Product */
     $product = Mage::getModel('catalog/product')->setStoreId($item->getStoreId())->load($item->getProductId());
     $data = array('orderLineId' => null, 'itemId' => (string) $item->getId(), 'orderNumber' => (string) $this->getOrderNumber(), 'quantity' => (double) $item->getQtyOrdered(), 'productSku' => (string) $item->getSku(), 'itemDescription' => (string) ($product->getShortDescription() ? $product->getShortDescription() : $product->getDescription()), 'unitPrice' => $this->_createOrderLinePrice($item, $item->getQtyOrdered()), 'totalTaxAmount' => $this->_createCurrencyAmount($item->getTaxAmount()), 'status' => $this->_createOrderItemStatus($item), 'price' => $this->_createCurrencyAmount($item->getBaseRowTotal()), 'allDiscounts' => null, 'dateCancelled' => null, 'dateDelivered' => null, 'dateShipped' => null, 'dateReturned' => null, 'dateInvoiced' => null, 'destination' => $this->_createShipTo($item->getOrder()->getShippingAddress()), 'shipmentId' => null, 'offerId' => null, 'offerUrl' => null);
     return $data;
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:13,代码来源:Order.php

示例8: getItemProduct

 /**
  * Get the product the item represents.
  *
  * @param Mage_Sales_Model_Order_Item
  * @return Mage_Catalog_Model_Product
  */
 protected function getItemProduct(Mage_Sales_Model_Order_Item $item)
 {
     // When dealing with configurable items, need to get tax data from
     // the child product and not the parent.
     if ($item->getProductType() === Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
         $sku = $item->getSku();
         $children = $item->getChildrenItems();
         if ($children) {
             /** @var Mage_Sales_Model_Order_Item $childItem */
             foreach ($children as $childItem) {
                 $childProduct = $childItem->getProduct();
                 // If the SKU of the child product matches the SKU of the
                 // item, the simple product being ordered was found and should
                 // be used.
                 if ($childProduct->getSku() === $sku) {
                     return $childProduct;
                 }
             }
         }
     }
     return $item->getProduct() ?: Mage::getModel('catalog/product')->load($item->getProductId());
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:28,代码来源:Orderitem.php

示例9: _pidListFromCollection

 /**
  * array_reduce callback to get comma separated list of product ids
  * @param string $result
  * @param Mage_Sales_Model_Quote_Item|Mage_Sales_Model_Order_Item $item
  * @return string
  */
 protected function _pidListFromCollection($result, $item)
 {
     $productId = $item->getSku();
     $result .= (empty($result) ? '' : ',') . $productId;
     return $result;
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:12,代码来源:Beacon.php

示例10: _scheduleSerialAssignment

 private function _scheduleSerialAssignment(Mage_Sales_Model_Order_Item $orderItem)
 {
     $queueItem = $this->getInfo('queue_item');
     if ($queueItem instanceof Gorilla_Queue_Model_Queue && $queueItem->getId()) {
         try {
             $queueItem->update();
             return true;
         } catch (Exception $e) {
             $ecodesException = new ICC_Ecodes_Exception($e->getMessage(), $e->getCode(), $e->getPrevious());
             Mage::logException($ecodesException);
             $this->addError('There was an error registering with the Queue. Some eCodes may not recieve serial assignments.');
             return false;
         }
     } else {
         try {
             Mage::getModel('gorilla_queue/queue')->addToQueue('ecodes/observer', 'assignSerialsFromQueue', array('order_item_id' => $orderItem->getId(), 'sku' => $orderItem->getSku(), 'gp_sku' => $this->getGpSkuFromProductId($orderItem->getProductId())), 'ecodes-assign-serials')->setShortDescription('Order Item ' . $orderItem->getId() . ' needs a serial. [' . $orderItem->getName() . ']')->save();
             return true;
         } catch (Exception $e) {
             $ecodesException = new ICC_Ecodes_Exception($e->getMessage(), $e->getCode(), $e->getPrevious());
             Mage::logException($ecodesException);
             $this->addError('There was an error registering with the Queue. Some eCodes may not recieve serial assignments.');
             return false;
         }
     }
 }
开发者ID:ankita-parashar,项目名称:magento,代码行数:25,代码来源:ICC_Ecodes_Model_Mysql4_Downloadable_Collection.php

示例11: _encodeOrderItem

 /**
  * Encodes an individual order item.
  *
  * @param array                       $mapping
  * @param Mage_Sales_Model_Order_Item $item
  *
  * @return \SixBySix\RealtimeDespatch\Entity\OrderLine
  */
 protected function _encodeOrderItem($mapping, Mage_Sales_Model_Order_Item $item)
 {
     $orderFlowLine = new RTDOrderLine();
     foreach ($mapping->asArray() as $magentoKey => $rtdKey) {
         $orderFlowLine->setParam($rtdKey, $item->{'get' . $magentoKey}());
     }
     $orderFlowLine->setProduct(new RTDProduct($item->getSku()));
     return $orderFlowLine;
 }
开发者ID:pierre-pizzetta,项目名称:orderflow-magento-module,代码行数:17,代码来源:Orders.php


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