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


PHP Mage_Sales_Model_Quote_Item_Abstract::getPrice方法代码示例

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


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

示例1: _injectPricingData

 /**
  * Add pricing data for the item to the item payload.
  *
  * @return self
  */
 protected function _injectPricingData()
 {
     $merchandisePricing = $this->_orderItem->getEmptyMerchandisePriceGroup()->setUnitPrice($this->_item->getPrice())->setAmount($this->_item->getRowTotal())->setTaxClass($this->_itemProduct->getTaxCode());
     $this->_discountHelper->transferTaxDiscounts($this->_item, $merchandisePricing);
     $this->_orderItem->setMerchandisePricing($merchandisePricing);
     // This will be set by the parent address when initially creating the
     // item request builder. Each ship group should include shipping on
     // only one item in the ship group for address level shipping totals.
     if ($this->_item->getIncludeShippingTotals()) {
         $shippingPricing = $this->_orderItem->getEmptyShippingPriceGroup()->setAmount($this->_address->getShippingAmount())->setTaxClass($this->_taxConfig->shippingTaxClass);
         $this->_addShippingDiscount($shippingPricing);
         $this->_orderItem->setShippingPricing($shippingPricing);
     }
     return $this;
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:20,代码来源:Item.php

示例2: _recalculateChildDiscount

 /**
  * Recalculate child discount. Separate discount between children
  *
  * @param   Mage_Sales_Model_Quote_Item_Abstract $child
  * @return  Mage_SalesRule_Model_Quote_Discount
  */
 protected function _recalculateChildDiscount($child)
 {
     $item = $child->getParentItem();
     $prices = array('base' => $item->getBaseOriginalPrice(), 'current' => $item->getPrice());
     $keys = array('discount_amount', 'original_discount_amount');
     foreach ($keys as $key) {
         $child->setData($key, $child->getData($key) * $child->getPrice() / $prices['current']);
         $child->setData('base_' . $key, $child->getData('base_' . $key) * $child->getPrice() / $prices['base']);
     }
     return $this;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:17,代码来源:Discount.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


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