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


PHP Mage_Sales_Model_Quote_Item_Abstract::getProductId方法代码示例

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


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

示例1: __construct

 /**
  * @param array $args Must contain key/value for:
  *                         - order_item_iterable => eBayEnterprise\RetailOrderManagement\Payload\TaxDutyFee\IOrderItemRequestIterable
  *                         - address => Mage_Sales_Model_Quote_Address
  *                         - item => Mage_Sales_Model_Quote_Item_Abstract
  *                         May contain key/value for:
  *                         - tax_helper => EbayEnterprise_Tax_Helper_Data
  *                         - payload_helper => EbayEnterprise_Tax_Helper_Payload
  *                         - tax_config => EbayEnterprise_Eb2cCore_Model_Config_Registry
  *                         - discount_helper => EbayEnterprise_Eb2cCore_Helper_Discount
  *                         - logger => EbayEnterprise_MageLog_Helper_Data
  *                         - log_context => EbayEnterprise_MageLog_Helper_Context
  */
 public function __construct(array $args)
 {
     list($this->_orderItemIterable, $this->_address, $this->_item, $this->_taxHelper, $this->_payloadHelper, $this->_taxConfig, $this->_discountHelper, $this->_logger, $this->_logContext) = $this->_checkTypes($args['order_item_iterable'], $args['address'], $args['item'], $this->_nullCoalesce($args, 'tax_helper', Mage::helper('ebayenterprise_tax')), $this->_nullCoalesce($args, 'payload_helper', Mage::helper('ebayenterprise_tax/payload')), $this->_nullCoalesce($args, 'tax_config', Mage::helper('ebayenterprise_tax')->getConfigModel()), $this->_nullCoalesce($args, 'discount_helper', Mage::helper('eb2ccore/discount')), $this->_nullCoalesce($args, 'logger', Mage::helper('ebayenterprise_magelog')), $this->_nullCoalesce($args, 'log_context', Mage::helper('ebayenterprise_magelog/context')));
     $this->_itemProduct = $this->_item->getProduct() ?: Mage::getModel('catalog/product')->load($this->_item->getProductId());
     $this->_orderItem = $this->_orderItemIterable->getEmptyOrderItem();
     $this->_populateRequest();
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:20,代码来源:Item.php

示例2: itemToOrderItem

 /**
  * Convert quote item to order item. Most part of the code was taken from Mage_Sales_Model_Convert_Quote::itemToOrderItem()
  *
  * @param Mage_Sales_Model_Quote_Item_Abstract $item
  * @param null|Mage_Sales_Model_Order_Item $orderItem
  * @return Mage_Sales_Model_Order_Item
  */
 public function itemToOrderItem(Mage_Sales_Model_Quote_Item_Abstract $item, $orderItem = null)
 {
     if (is_null($orderItem)) {
         $orderItem = Mage::getModel('sales/order_item');
     }
     $orderItem->setStoreId($item->getStoreId())->setQuoteItemId($item->getId())->setQuoteParentItemId($item->getParentItemId())->setProductId($item->getProductId())->setProductType($item->getProductType())->setQtyBackordered($item->getBackorders())->setProduct($item->getProduct())->setBaseOriginalPrice($item->getBaseOriginalPrice());
     $options = $item->getProductOrderOptions();
     if (!$options) {
         $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
     }
     $orderItem->setProductOptions($options);
     Mage::helper('core')->copyFieldset('sales_convert_quote_item', 'to_order_item', $item, $orderItem);
     if ($item->getParentItem()) {
         $orderItem->setQtyOrdered($orderItem->getQtyOrdered() * $item->getParentItem()->getQty());
     }
     if (!$item->getNoDiscount()) {
         Mage::helper('core')->copyFieldset('sales_convert_quote_item', 'to_order_item_discount', $item, $orderItem);
     }
     Mage::dispatchEvent('sales_convert_quote_item_to_order_item', array('order_item' => $orderItem, 'item' => $item));
     return $orderItem;
 }
开发者ID:AleksNesh,项目名称:pandora,代码行数:28,代码来源:Convert.php

示例3: itemToOrderItem

 /**
  * Convert quote item to order item
  *
  * @param   Mage_Sales_Model_Quote_Item_Abstract $item
  * @return  Mage_Sales_Model_Order_Item
  */
 public function itemToOrderItem(Mage_Sales_Model_Quote_Item_Abstract $item)
 {
     $orderItem = Mage::getModel('sales/order_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())->setIsQtyDecimal($item->getIsQtyDecimal())->setQtyOrdered($item->getQty())->setOriginalPrice($item->getOriginalPrice())->setAppliedRuleIds($item->getAppliedRuleIds())->setAdditionalData($item->getAdditionalData())->setPrice($item->getCalculationPrice())->setTaxPercent($item->getTaxPercent())->setTaxAmount($item->getTaxAmount())->setRowWeight($item->getRowWeight())->setRowTotal($item->getRowTotal())->setBasePrice($item->getBaseCalculationPrice())->setBaseOriginalPrice($item->getPrice())->setBaseTaxAmount($item->getBaseTaxAmount())->setBaseRowTotal($item->getBaseRowTotal());
     if (!$item->getNoDiscount()) {
         $orderItem->setDiscountPercent($item->getDiscountPercent())->setDiscountAmount($item->getDiscountAmount())->setBaseDiscountAmount($item->getBaseDiscountAmount());
     }
     Mage::dispatchEvent('sales_convert_quote_item_to_order_item', array('order_item' => $orderItem, 'item' => $item));
     return $orderItem;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:15,代码来源:Quote.php

示例4: itemToOrderItem

 /**
  * Convert quote item to order item
  *
  * @param   Mage_Sales_Model_Quote_Item_Abstract $item
  * @return  Mage_Sales_Model_Order_Item
  */
 public function itemToOrderItem(Mage_Sales_Model_Quote_Item_Abstract $item)
 {
     $orderItem = AO::getModel('sales/order_item')->setStoreId($item->getStoreId())->setQuoteItemId($item->getId())->setQuoteParentItemId($item->getParentItemId())->setProductId($item->getProductId())->setProductType($item->getProductType())->setProductOptions($item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct()))->setQtyBackordered($item->getBackorders());
     AO::helper('core')->copyFieldset('sales_convert_quote_item', 'to_order_item', $item, $orderItem);
     if ($item->getParentItem()) {
         $orderItem->setQtyOrdered($orderItem->getQtyOrdered() * $item->getParentItem()->getQty());
     }
     //            ->setSku($item->getSku())
     //            ->setName($item->getName())
     //            ->setDescription($item->getDescription())
     //            ->setWeight($item->getWeight())
     //            ->setIsQtyDecimal($item->getIsQtyDecimal())
     //            ->setQtyOrdered($item->getQty())
     //            ->setOriginalPrice($item->getOriginalPrice())
     //            ->setAppliedRuleIds($item->getAppliedRuleIds())
     //            ->setAdditionalData($item->getAdditionalData())
     //
     //            ->setPrice($item->getCalculationPrice())
     //            ->setTaxPercent($item->getTaxPercent())
     //            ->setTaxAmount($item->getTaxAmount())
     //            ->setRowWeight($item->getRowWeight())
     //            ->setRowTotal($item->getRowTotal())
     //
     //            ->setBasePrice($item->getBaseCalculationPrice())
     //            ->setBaseOriginalPrice($item->getPrice())
     //            ->setBaseTaxAmount($item->getBaseTaxAmount())
     //            ->setBaseRowTotal($item->getBaseRowTotal());
     if (!$item->getNoDiscount()) {
         AO::helper('core')->copyFieldset('sales_convert_quote_item', 'to_order_item_discount', $item, $orderItem);
         //            $orderItem->setDiscountPercent($item->getDiscountPercent())
         //                ->setDiscountAmount($item->getDiscountAmount())
         //                ->setBaseDiscountAmount($item->getBaseDiscountAmount());
     }
     AO::dispatchEvent('sales_convert_quote_item_to_order_item', array('order_item' => $orderItem, 'item' => $item));
     return $orderItem;
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:42,代码来源:Convert_Quote.php

示例5: getItemProduct

 /**
  * Get the product the item represents.
  *
  * @param Mage_Sales_Model_Quote_Item_Abstract
  * @return Mage_Catalog_Model_Product
  */
 protected function getItemProduct(Mage_Sales_Model_Quote_Item_Abstract $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->getChildren();
         if ($children) {
             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,代码行数:27,代码来源:Item.php


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