本文整理汇总了PHP中Mage_Sales_Model_Quote_Item::getTaxAmount方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote_Item::getTaxAmount方法的具体用法?PHP Mage_Sales_Model_Quote_Item::getTaxAmount怎么用?PHP Mage_Sales_Model_Quote_Item::getTaxAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote_Item
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote_Item::getTaxAmount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayRowTotalWithDiscountInclTax
/**
* Returns the item's row total with any discount and also with any tax
*
* @param Mage_Sales_Model_Quote_Item $item
* @return string
*/
public function displayRowTotalWithDiscountInclTax($item)
{
$tax = $item->getTaxAmount() ? $item->getTaxAmount() : 0;
return $this->formatPrice($item->getRowTotal() - $item->getDiscountAmount() + $tax);
}
示例2: _getTotalFixedDiscountOnitem
/**
* Returns a total discount on the cart from the provided items
* @deprecated @see TBT_Rewards_Model_Salesrule_Discount_Action_Cartfixed
*
* @param Mage_Sales_Model_Quote_Item $item
* @param Mage_Sales_Model_Quote_Address $address
* @param TBT_Rewards_Model_Sales_Rule $rule
* @param array() &$cartRules
* @return array($discountAmount, $baseDiscountAmount)
*/
protected function _getTotalFixedDiscountOnitem($item, $address, $rule, &$cartRules)
{
$quote = $item->getQuote();
$store = $item->getQuote()->getStore();
$quoteAmount = $quote->getStore()->convertPrice($cartRules[$rule->getId()]);
if ($rule->getPointsAction() == TBT_Rewards_Model_Salesrule_Actions::ACTION_DISCOUNT_BY_POINTS_SPENT) {
$points_spent = Mage::getSingleton('rewards/session')->getPointsSpending();
$multiplier = floor($points_spent / $rule->getPointsAmount());
} else {
$multiplier = 1;
}
$quoteAmount = $quote->getStore()->convertPrice($cartRules[$rule->getId()]);
if (Mage::helper('tax')->discountTax($store) && !Mage::helper('tax')->applyTaxAfterDiscount($store)) {
$tax_amount = $item->getTaxAmount();
$base_tax_amount = $item->getBaseTaxAmount();
} else {
$tax_amount = 0;
$base_tax_amount = 0;
}
if (Mage::helper('rewards')->isBaseMageVersionAtLeast('1.4.2')) {
$itemPrice = $this->_getItemPrice($item);
$baseItemPrice = $this->_getItemBasePrice($item);
$qty = $this->_getItemQty($item, $rule);
if (1 >= $this->_rulesItemTotals[$rule->getId()]['items_count']) {
$quoteAmount = $quote->getStore()->convertPrice($cartRules[$rule->getId()]);
$discountAmount = min($itemPrice * $qty, $quoteAmount);
$baseDiscountAmount = min($baseItemPrice * $qty, $cartRules[$rule->getId()]);
} else {
$discountRate = $baseItemPrice * $qty / $this->_rulesItemTotals[$rule->getId()]['base_items_price'];
$maximumItemDiscount = $rule->getDiscountAmount() * $discountRate;
$quoteAmount = $quote->getStore()->convertPrice($maximumItemDiscount);
$discountAmount = min($itemPrice * $qty, $quoteAmount);
$baseDiscountAmount = min($baseItemPrice * $qty, $maximumItemDiscount);
$this->_rulesItemTotals[$rule->getId()]['items_count']--;
}
} else {
$discountAmount = min($item->getRowTotal() - $item->getDiscountAmount() + $tax_amount, $quoteAmount);
$baseDiscountAmount = min($item->getBaseRowTotal() - $item->getBaseDiscountAmount() + $base_tax_amount, $cartRules[$rule->getId()]);
}
return array($discountAmount, $baseDiscountAmount);
}