本文整理汇总了PHP中Mage_Sales_Model_Order_Item::getRowTotal方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Item::getRowTotal方法的具体用法?PHP Mage_Sales_Model_Order_Item::getRowTotal怎么用?PHP Mage_Sales_Model_Order_Item::getRowTotal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order_Item
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order_Item::getRowTotal方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItemTotal
/**
* Calculates and returns the grand total of an item including tax and excluding
* discount.
*
* @param Mage_Sales_Model_Order_Item $item The item to return info from
* @return Float The grand total
*/
function getItemTotal($item)
{
return $item->getRowTotal() - $item->getDiscountAmount() + $item->getTaxAmount() + $item->getWeeeTaxAppliedRowAmount();
}
示例2: addWeeeTaxesToPriceXmlApi23
/**
* Add Weee taxes child to the XML. Api version 23
*
* @param Mage_Core_Block_Template $renderer Product renderer
* @param Mage_Sales_Model_Order_Item $item
* @param Mage_XmlConnect_Model_Simplexml_Element $parentXml
* @param array $params Params for Weee taxes: 'include' - Price including tax, 'is_subtotal' - Flag of subtotal
* @param string $idPrefix
* @param bool $isIncludeTax
* @return null
*/
public function addWeeeTaxesToPriceXmlApi23(Mage_Core_Block_Template $renderer, Mage_Sales_Model_Order_Item $item, Mage_XmlConnect_Model_Simplexml_Element $parentXml, $params = array(), $idPrefix, $isIncludeTax)
{
$weeTaxes = $renderer->getWeeeTaxes();
if (empty($weeTaxes)) {
return;
}
$typesOfDisplay = $renderer->getTypesOfDisplay();
$row = isset($params['is_subtotal']) && $params['is_subtotal'] ? 'row_' : '';
if ($isIncludeTax) {
$weeeXml = $parentXml->addCustomChild('price', null, array('id' => 'weee'));
/** @var $weeeXml Mage_XmlConnect_Model_Simplexml_Element */
if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_1]) {
foreach ($weeTaxes as $tax) {
$taxAmount = Mage::helper('xmlconnect')->formatPriceForXml($tax[$row . 'amount']);
$weeeXml->addCustomChild('item', $taxAmount, array('label' => $tax['title'], 'formatted_price' => $this->formatPrice($renderer, $tax[$row . 'amount'])));
}
} elseif ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_2] || $typesOfDisplay[self::PRICE_DISPLAY_TYPE_4]) {
foreach ($weeTaxes as $tax) {
$taxAmount = Mage::helper('xmlconnect')->formatPriceForXml($tax[$row . 'amount_incl_tax']);
$weeeXml->addCustomChild('item', $taxAmount, array('label' => $tax['title'], 'formatted_price' => $this->formatPrice($renderer, $tax[$row . 'amount_incl_tax'])));
}
}
}
if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_2]) {
if (!empty($params['include'])) {
// including tax
if (isset($params['is_subtotal'])) {
$total = $params['include'] + $item->getWeeeTaxAppliedRowAmount();
} else {
$total = $params['include'] + $renderer->getWeeeTaxAppliedAmount();
}
} else {
// excluding tax
if (isset($params['is_subtotal'])) {
$total = $item->getRowTotal() + $item->getWeeeTaxAppliedRowAmount() + $item->getWeeeTaxRowDisposition();
} else {
$total = $item->getPrice() + $renderer->getWeeeTaxAppliedAmount() + $renderer->getWeeeTaxDisposition();
}
}
$totalNodeId = $idPrefix . 'fpt_total_' . ($isIncludeTax ? self::INCLUDING_TAX_ID : self::EXCLUDING_TAX_ID);
$parentXml->addCustomChild('price', Mage::helper('xmlconnect')->formatPriceForXml($total), array('id' => $totalNodeId, 'label' => $isIncludeTax ? $renderer->helper('weee')->__('Total incl. tax') : $renderer->helper('weee')->__('Total excl. tax'), 'formatted_price' => $this->formatPrice($renderer, $total)));
}
}
示例3: addWeeeTaxesToPriceXml
/**
* Add Weee taxes child to the XML
*
* @param Mage_Core_Block_Template $renderer Product renderer
* @param Mage_Sales_Model_Order_Item $item
* @param Mage_XmlConnect_Model_Simplexml_Element $parentXml
* @param array $params Params for Weee taxes: 'include' - Price including tax, 'is_subtotal' - Flag of subtotal
* @return null
*/
public function addWeeeTaxesToPriceXml(Mage_Core_Block_Template $renderer, Mage_Sales_Model_Order_Item $item, Mage_XmlConnect_Model_Simplexml_Element $parentXml, $params = array())
{
$weeTaxes = $renderer->getWeeeTaxes();
if (empty($weeTaxes)) {
return;
}
$typesOfDisplay = $renderer->getTypesOfDisplay();
$row = isset($params['is_subtotal']) && $params['is_subtotal'] ? 'row_' : '';
/** @var $weeeXml Mage_XmlConnect_Model_Simplexml_Element */
if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_1]) {
$weeeXml = $parentXml->addChild('weee');
foreach ($weeTaxes as $tax) {
$weeeXml->addCustomChild('tax', $this->formatPrice($renderer, $tax[$row . 'amount']), array('label' => $tax['title']));
}
} elseif ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_2] || $typesOfDisplay[self::PRICE_DISPLAY_TYPE_4]) {
$weeeXml = $parentXml->addChild('weee');
foreach ($weeTaxes as $tax) {
$weeeXml->addCustomChild('tax', $this->formatPrice($renderer, $tax[$row . 'amount_incl_tax']), array('label' => $tax['title']));
}
}
if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_2]) {
if (!is_null($params['include'])) {
// including tax
if (isset($params['is_subtotal'])) {
$total = $params['include'] + $item->getWeeeTaxAppliedRowAmount();
} else {
$total = $params['include'] + $renderer->getWeeeTaxAppliedAmount();
}
} else {
// excluding tax
if ($params['is_subtotal']) {
$total = $item->getRowTotal() + $item->getWeeeTaxAppliedRowAmount() + $item->getWeeeTaxRowDisposition();
} else {
$total = $item->getPrice() + $renderer->getWeeeTaxAppliedAmount() + $renderer->getWeeeTaxDisposition();
}
}
if (!isset($weeeXml)) {
$weeeXml = $parentXml->addChild('weee');
}
$weeeXml->addCustomChild('total', $this->formatPrice($renderer, $total), array('label' => $renderer->helper('weee')->__('Total')));
}
}
示例4: 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;
}
示例5: prepareMerchandisePricing
/**
* fillout the merchandise price group payload for the order item
* @param Mage_Sales_Model_Order_Item
* @param IPriceGroup
* @return self
*/
protected function prepareMerchandisePricing(Mage_Sales_Model_Order_Item $item, IPriceGroup $merch)
{
$merch->setAmount($item->getRowTotal())->setUnitPrice($item->getPrice());
$this->discountHelper->transferDiscounts($item, $merch);
return $this;
}
示例6: getItemTotal
/**
* Calculates and returns the grand total of an item including tax and excluding
* discount.
*
* @param Mage_Sales_Model_Order_Item $item The item to return info from
* @return Float The grand total
*/
protected function getItemTotal($item)
{
//return $item->getRowTotal() - $item->getDiscountAmount() + $item->getTaxAmount() + $item->getWeeeTaxAppliedRowAmount();
return $item->getRowTotal() + $item->getTaxAmount() + $item->getHiddenTaxAmount() + $item->getWeeeTaxAppliedRowAmount() - $item->getDiscountAmount();
}
示例7: _getTotalItemCatalogDiscount
/**
* Returns the total accumulated catalog discounts on an item
* @param Mage_Sales_Model_Quote_Item|Mage_Sales_Model_Order_Item $item
* @return int negative discount amount
*/
protected function _getTotalItemCatalogDiscount($item)
{
if (!$item->getQuoteId() || !$item->getId()) {
return 0;
}
$row_total_before_disc = $item->getRowTotalBeforeRedemptions();
$row_total = $item->getRowTotal();
if ($item->getRewardsCatalogDiscount()) {
$total_discount = $item->getRewardsCatalogDiscount();
} else {
if (empty($row_total_before_disc)) {
$item->setRowTotal($item->getRowTotalBeforeRedemptions());
$item->setRowTotalInclTax($item->getRowTotalBeforeRedemptionsInclTax());
$total_discount = $this->_getRedeemer()->getTotalCatalogDiscount($item);
} else {
$total_discount = $item->getRowTotalBeforeRedemptions() - $item->getRowTotal();
}
}
return $total_discount;
}