本文整理汇总了PHP中Mage_Sales_Model_Quote_Item_Abstract::setRowTotal方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote_Item_Abstract::setRowTotal方法的具体用法?PHP Mage_Sales_Model_Quote_Item_Abstract::setRowTotal怎么用?PHP Mage_Sales_Model_Quote_Item_Abstract::setRowTotal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote_Item_Abstract
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote_Item_Abstract::setRowTotal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _recalculateParent
/**
* Recalculate row information for item based on children calculation
*
* @param Mage_Sales_Model_Quote_Item_Abstract $item
* @return Mage_Tax_Model_Sales_Total_Quote_Subtotal
*/
protected function _recalculateParent(Mage_Sales_Model_Quote_Item_Abstract $item)
{
$price = 0;
$basePrice = 0;
$rowTotal = 0;
$baseRowTotal = 0;
$priceInclTax = 0;
$basePriceInclTax = 0;
$rowTotalInclTax = 0;
$baseRowTotalInclTax = 0;
foreach ($item->getChildren() as $child) {
$price += $child->getPrice() * $child->getQty();
$basePrice += $child->getBasePrice() * $child->getQty();
$rowTotal += $child->getRowTotal();
$baseRowTotal += $child->getBaseRowTotal();
$priceInclTax += $child->getPriceInclTax() * $child->getQty();
$basePriceInclTax += $child->getBasePriceInclTax() * $child->getQty();
$rowTotalInclTax += $child->getRowTotalInclTax();
$baseRowTotalInclTax += $child->getBaseRowTotalInclTax();
}
/**
*
* Customisation To make the custom price work with configurable items
*
**/
if ($item->getCustomPrice()) {
$customPrice = $item->getCustomPrice();
$price = $customPrice;
$basePrice = $customPrice;
$rowTotal = $customPrice * $item->getQty();
$baseRowTotal = $customPrice * $item->getQty();
$priceInclTax = $customPrice;
$basePriceInclTax = $customPrice;
$rowTotalInclTax = $customPrice * $item->getQty();
$baseRowTotalInclTax = $customPrice * $item->getQty();
}
$item->setConvertedPrice($price);
$item->setPrice($basePrice);
$item->setRowTotal($rowTotal);
$item->setBaseRowTotal($baseRowTotal);
$item->setPriceInclTax($priceInclTax);
$item->setBasePriceInclTax($basePriceInclTax);
$item->setRowTotalInclTax($rowTotalInclTax);
$item->setBaseRowTotalInclTax($baseRowTotalInclTax);
return $this;
}
示例2: _recollectItem
/**
* Recollect item price and row total using after taxes subtract.
* Declare item price including tax attributes
*
* @deprecated after 1.4.1
*
* @param Mage_Sales_Model_Quote_Address $address
* @param Mage_Sales_Model_Quote_Item_Abstract $item
*
* @return Mage_Tax_Model_Sales_Total_Quote_Subtotal
*/
protected function _recollectItem($address, Mage_Sales_Model_Quote_Item_Abstract $item)
{
$store = $address->getQuote()->getStore();
$request = $this->_getStoreTaxRequest($address);
$request->setProductClassId($item->getProduct()->getTaxClassId());
$rate = $this->_calculator->getRate($request);
$qty = $item->getTotalQty();
$price = $taxPrice = $item->getCalculationPriceOriginal();
$basePrice = $baseTaxPrice = $item->getBaseCalculationPriceOriginal();
$subtotal = $taxSubtotal = $item->getRowTotal();
$baseSubtotal = $baseTaxSubtotal = $item->getBaseRowTotal();
if ($this->_config->discountTax($store)) {
$item->setDiscountCalculationPrice($price);
$item->setBaseDiscountCalculationPrice($basePrice);
}
/**
* Use original price for tax calculation
*/
if ($item->hasCustomPrice() && !$this->_helper->applyTaxOnCustomPrice($store)) {
$taxPrice = $item->getOriginalPrice();
$baseTaxPrice = $item->getBaseOriginalPrice();
$taxSubtotal = $taxPrice * $qty;
$baseTaxSubtotal = $baseTaxPrice * $qty;
}
if ($this->_areTaxRequestsSimilar) {
$item->setRowTotalInclTax($subtotal);
$item->setBaseRowTotalInclTax($baseSubtotal);
$item->setPriceInclTax($price);
$item->setBasePriceInclTax($basePrice);
$item->setTaxCalcPrice($taxPrice);
$item->setBaseTaxCalcPrice($baseTaxPrice);
$item->setTaxCalcRowTotal($taxSubtotal);
$item->setBaseTaxCalcRowTotal($baseTaxSubtotal);
}
$this->_subtotalInclTax += $subtotal;
$this->_baseSubtotalInclTax += $baseSubtotal;
if ($this->_config->getAlgorithm($store) == Mage_Tax_Model_Calculation::CALC_UNIT_BASE) {
$taxAmount = $this->_calculator->calcTaxAmount($taxPrice, $rate, true);
$baseTaxAmount = $this->_calculator->calcTaxAmount($baseTaxPrice, $rate, true);
$unitPrice = $this->_calculator->round($price - $taxAmount);
$baseUnitPrice = $this->_calculator->round($basePrice - $baseTaxAmount);
$subtotal = $this->_calculator->round($unitPrice * $qty);
$baseSubtotal = $this->_calculator->round($baseUnitPrice * $qty);
} else {
$taxAmount = $this->_calculator->calcTaxAmount($taxSubtotal, $rate, true, false);
$baseTaxAmount = $this->_calculator->calcTaxAmount($baseTaxSubtotal, $rate, true, false);
$unitPrice = ($subtotal - $taxAmount) / $qty;
$baseUnitPrice = ($baseSubtotal - $baseTaxAmount) / $qty;
$subtotal = $this->_calculator->round($subtotal - $taxAmount);
$baseSubtotal = $this->_calculator->round($baseSubtotal - $baseTaxAmount);
}
if ($item->hasCustomPrice()) {
$item->setCustomPrice($unitPrice);
$item->setBaseCustomPrice($baseUnitPrice);
}
$item->setPrice($baseUnitPrice);
$item->setOriginalPrice($unitPrice);
$item->setBasePrice($baseUnitPrice);
$item->setRowTotal($subtotal);
$item->setBaseRowTotal($baseSubtotal);
return $this;
}
示例3: _recalculateParent
/**
* Recalculate row information for item based on children calculation
*
* @param Mage_Sales_Model_Quote_Item_Abstract $item
* @return Mage_Tax_Model_Sales_Total_Quote_Subtotal
*/
protected function _recalculateParent(Mage_Sales_Model_Quote_Item_Abstract $item)
{
$price = 0;
$basePrice = 0;
$rowTotal = 0;
$baseRowTotal = 0;
$priceInclTax = 0;
$basePriceInclTax = 0;
$rowTotalInclTax = 0;
$baseRowTotalInclTax = 0;
foreach ($item->getChildren() as $child) {
$price += $child->getPrice() * $child->getQty();
$basePrice += $child->getBasePrice() * $child->getQty();
$rowTotal += $child->getRowTotal();
$baseRowTotal += $child->getBaseRowTotal();
$priceInclTax += $child->getPriceInclTax() * $child->getQty();
$basePriceInclTax += $child->getBasePriceInclTax() * $child->getQty();
$rowTotalInclTax += $child->getRowTotalInclTax();
$baseRowTotalInclTax += $child->getBaseRowTotalInclTax();
}
$item->setConvertedPrice($price);
$item->setPrice($basePrice);
$item->setRowTotal($rowTotal);
$item->setBaseRowTotal($baseRowTotal);
$item->setPriceInclTax($priceInclTax);
$item->setBasePriceInclTax($basePriceInclTax);
$item->setRowTotalInclTax($rowTotalInclTax);
$item->setBaseRowTotalInclTax($baseRowTotalInclTax);
return $this;
}
示例4: _recalculateParent
/**
* Recalculate parent item amounts base on children data
*
* @param Mage_Sales_Model_Quote_Item_Abstract $item
* @return Mage_Tax_Model_Sales_Total_Quote
*/
protected function _recalculateParent(Mage_Sales_Model_Quote_Item_Abstract $item)
{
$calculationPrice = 0;
$baseCalculationPrice = 0;
$rowTaxAmount = 0;
$baseRowTaxAmount = 0;
$rowTotal = 0;
$baseRowTotal = 0;
foreach ($item->getChildren() as $child) {
$calculationPrice += $child->getCalculationPrice();
$baseCalculationPrice += $child->getBaseCalculationPrice();
$rowTaxAmount += $child->getTaxAmount();
$baseRowTaxAmount += $child->getBaseTaxAmount();
$rowTotal += $child->getRowTotal();
$baseRowTotal += $child->getBaseRowTotal();
}
$item->setOriginalPrice($calculationPrice);
$item->setPrice($baseCalculationPrice);
$item->setTaxAmount($rowTaxAmount);
$item->setBaseTaxAmount($baseRowTaxAmount);
$item->setRowTotal($rowTotal);
$item->setBaseRowTotal($baseRowTotal);
return $this;
}
示例5: _recalculateParent
/**
* Recalculate row information for item based on children calculation
*
* @param Mage_Sales_Model_Quote_Item_Abstract $item
* @return Mage_Tax_Model_Sales_Total_Quote_Subtotal
*/
protected function _recalculateParent(Mage_Sales_Model_Quote_Item_Abstract $item)
{
$price = 0;
$basePrice = 0;
$rowTotal = 0;
$baseRowTotal = 0;
$priceInclTax = 0;
$basePriceInclTax = 0;
$rowTotalInclTax = 0;
$baseRowTotalInclTax = 0;
foreach ($item->getChildren() as $child) {
$price += $child->getOriginalPrice();
$basePrice += $child->getBaseOriginalPrice();
$rowTotal += $child->getRowTotal();
$baseRowTotal += $child->getBaseRowTotal();
$priceInclTax += $child->getPriceInclTax();
$basePriceInclTax += $child->getBasePriceInclTax();
$rowTotalInclTax += $child->getRowTotalInclTax();
$baseRowTotalInclTax += $child->getBaseRowTotalInclTax();
}
$item->setOriginalPrice($price);
$item->setPrice($basePrice);
$item->setRowTotal($rowTotal);
$item->setBaseRowTotal($baseRowTotal);
if ($this->_areTaxRequestsSimilar) {
$item->setPriceInclTax($priceInclTax);
$item->setBasePriceInclTax($basePriceInclTax);
$item->setRowTotalInclTax($rowTotalInclTax);
$item->setBaseRowTotalInclTax($baseRowTotalInclTax);
}
return $this;
}