本文整理汇总了PHP中Mage_Sales_Model_Quote_Item::setQty方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote_Item::setQty方法的具体用法?PHP Mage_Sales_Model_Quote_Item::setQty怎么用?PHP Mage_Sales_Model_Quote_Item::setQty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote_Item
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote_Item::setQty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItemInclFreeTotals
/**
* Assigns totals values using variables passed in by reference.
*
* @param Mage_Sales_Model_Quote_Item $item
* @param int $weight
* @param int $qty
* @param int $price
* @param $freeMethodWeight
* @param bool $useParent
* @param bool $ignoreFreeItems
* @param array $itemGroup
* @param bool $useDiscountValue
* @param bool $cartFreeShipping
* @param bool $useBase
* @param bool $useTax
* @param int $basePriceInclTax
* @return bool
*/
public static function getItemInclFreeTotals($item, &$weight, &$qty, &$price, &$freeMethodWeight, $useParent = true, $ignoreFreeItems = true, &$itemGroup = array(), $useDiscountValue = false, $cartFreeShipping = false, $useBase = false, $useTax = false, &$basePriceInclTax = 0)
{
$adminOrder = false;
/**
* if order is placed in admin and we're using the sales_order event qty isn't set.
* DIMSHIP-143
*/
if ($item->getQtyOrdered() && !$item->getQty()) {
$item->setQty($item->getQtyOrdered());
$adminOrder = true;
}
$totals = Mage::helper('wsacommon/totals')->getTotals($item, $useParent, $ignoreFreeItems, $cartFreeShipping);
if ($adminOrder) {
self::removeQty($item);
}
if (!$totals) {
return false;
} else {
$weight = $totals->getWeight();
$qty = $totals->getQty();
if (!$useDiscountValue) {
$useTax && !$useBase ? $price = $totals->getPriceInclTax() : false;
$useTax && $useBase ? $price = $totals->getBasePriceInclTax() : false;
!$useTax && !$useBase ? $price = $totals->getPrice() : false;
!$useTax && $useBase ? $price = $totals->getBasePrice() : false;
} else {
$useTax && !$useBase ? $price = $totals->getDiscountedPriceInclTax() : false;
$useTax && $useBase ? $price = $totals->getBaseDiscountedPriceInclTax() : false;
!$useTax && !$useBase ? $price = $totals->getDiscountedPrice() : false;
!$useTax && $useBase ? $price = $totals->getBaseDiscountedPrice() : false;
}
$freeMethodWeight = $totals->getFreeMethodWeight();
self::processItemGroup($itemGroup, $item);
return true;
}
}