本文整理汇总了PHP中Mage_Sales_Model_Quote::getBaseSubtotal方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote::getBaseSubtotal方法的具体用法?PHP Mage_Sales_Model_Quote::getBaseSubtotal怎么用?PHP Mage_Sales_Model_Quote::getBaseSubtotal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote::getBaseSubtotal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _fillCartInformation
/**
* @param array $data
* @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
*/
private function _fillCartInformation(&$data, $object)
{
$productIids = array();
$productQtys = array();
$productStyleIds = array();
/** @var Mage_Sales_Model_Quote_Item|Mage_Sales_Model_Order_Item $item */
foreach ($object->getAllVisibleItems() as $item) {
$productIids[] = $item->getProduct()->getIid();
$productQtys[] = is_null($item->getQtyOrdered()) ? (int) $item->getQty() : (int) $item->getQtyOrdered();
$productStyleIds[] = $item->getProduct()->getNumber() . '-' . $item->getProduct()->getColorCode();
}
$data['productStyleId'] = implode(',', $productStyleIds);
$data['cartProductIds'] = implode(',', $productIids);
$data['cartProductQtys'] = implode(',', $productQtys);
$data['cartTotalNetto'] = round($object->getBaseSubtotal(), 2);
$data['cartTotalBrutto'] = round($object->getBaseGrandTotal(), 2);
$data['customerId'] = (int) $object->getCustomerId();
// For zanox tracking
if (array_key_exists('zanpid', $_COOKIE) && $_COOKIE['zanpid'] != '') {
$data['zanpid'] = $_COOKIE['zanpid'];
}
}
示例2: isApplicableToQuote
/**
* Check whether payment method is applicable to quote
* Purposed to allow use in controllers some logic that was implemented in blocks only before
*
* @param Mage_Sales_Model_Quote $quote
* @param int|null $checksBitMask
* @return bool
*/
public function isApplicableToQuote($quote, $checksBitMask)
{
if ($checksBitMask & self::CHECK_USE_FOR_COUNTRY) {
if (!$this->canUseForCountry($quote->getBillingAddress()->getCountry())) {
return false;
}
}
if ($checksBitMask & self::CHECK_USE_FOR_CURRENCY) {
if (!$this->canUseForCurrency($quote->getStore()->getBaseCurrencyCode())) {
return false;
}
}
if ($checksBitMask & self::CHECK_USE_CHECKOUT) {
if (!$this->canUseCheckout()) {
return false;
}
}
if ($checksBitMask & self::CHECK_USE_FOR_MULTISHIPPING) {
if (!$this->canUseForMultishipping()) {
return false;
}
}
if ($checksBitMask & self::CHECK_USE_INTERNAL) {
if (!$this->canUseInternal()) {
return false;
}
}
if ($checksBitMask & self::CHECK_ORDER_TOTAL_MIN_MAX) {
$total = $quote->getBaseGrandTotal();
$minTotal = $this->getConfigData('min_order_total');
$maxTotal = $this->getConfigData('max_order_total');
if (!empty($minTotal) && $total < $minTotal || !empty($maxTotal) && $total > $maxTotal) {
return false;
}
}
if ($checksBitMask & self::CHECK_RECURRING_PROFILES) {
if (!$this->canManageRecurringProfiles() && $quote->hasRecurringItems()) {
return false;
}
}
if ($checksBitMask & self::CHECK_ZERO_TOTAL) {
$total = $quote->getBaseSubtotal() + $quote->getShippingAddress()->getBaseShippingAmount();
if ($total < 0.0001 && $this->getCode() != 'free' && !($this->canManageRecurringProfiles() && $quote->hasRecurringItems())) {
return false;
}
}
return true;
}
示例3: buildAmount
/**
* Build Amount
*
* @param Mage_Sales_Model_Quote $quote
* @return Amount
*/
protected function buildAmount($quote)
{
$details = new Details();
$details->setShipping($quote->getShippingAddress()->getBaseShippingAmount())->setTax($quote->getBillingAddress()->getBaseTaxAmount() + $quote->getBillingAddress()->getBaseHiddenTaxAmount() + $quote->getShippingAddress()->getBaseTaxAmount() + $quote->getShippingAddress()->getBaseHiddenTaxAmount())->setSubtotal($quote->getBaseSubtotal());
$totals = $quote->getTotals();
if (isset($totals['discount']) && $totals['discount']->getValue()) {
$details->setShippingDiscount(-$totals['discount']->getValue());
}
$amount = new Amount();
$amount->setCurrency($quote->getBaseCurrencyCode())->setDetails($details)->setTotal($quote->getBaseGrandTotal());
return $amount;
}