本文整理汇总了PHP中Mage_Sales_Model_Quote::getSubtotal方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote::getSubtotal方法的具体用法?PHP Mage_Sales_Model_Quote::getSubtotal怎么用?PHP Mage_Sales_Model_Quote::getSubtotal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote::getSubtotal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isAvailable
/**
* Open Invoice DE is not available if quote has a coupon
*
* @param Mage_Sales_Model_Quote $quote
* @return boolean
*/
public function isAvailable($quote = null)
{
/* availability depends on quote */
if (false == $quote instanceof Mage_Sales_Model_Quote) {
return false;
}
/* not available if quote contains a coupon and allow_discounted_carts is disabled */
if (!$this->isAvailableForDiscountedCarts() && $quote->getSubtotal() != $quote->getSubtotalWithDiscount()) {
return false;
}
/* not available if there is no gender or no birthday */
if (is_null($quote->getCustomerGender()) || is_null($quote->getCustomerDob())) {
return false;
}
return parent::isAvailable($quote);
}
示例2: isRequiredForQuote
/**
* @param Mage_Sales_Model_Quote $quote
* @return bool
*/
protected function isRequiredForQuote(Mage_Sales_Model_Quote $quote)
{
$config = $this->getConfig();
$quoteTotal = $quote->getSubtotal();
/** @var $method Payone_Core_Model_Config_Payment_Method_Interface */
$maxOrderTotal = $config->getMaxOrderTotal();
$minOrderTotal = $config->getMinOrderTotal();
if (!empty($maxOrderTotal) and $maxOrderTotal < $quoteTotal) {
return false;
// quote total too high.
}
if (!empty($minOrderTotal) and $minOrderTotal > $quoteTotal) {
return false;
// quote total is too low.
}
return true;
}
示例3: addTotal
/**
* @param \Vbw\Procurement\Punchout\Order $poOrder
* @param Mage_Sales_Model_Quote $quote
*/
public function addTotal($poOrder, $quote)
{
$configHelper = Mage::helper('vbw_punchout/config');
/**@var $dataHelper Vbw_Punchout_Helper_Data*/
$dataHelper = Mage::helper('vbw_punchout/data');
/** @var $body \Vbw\Procurement\Punchout\Order\Body */
$body = $poOrder->getBody();
$totals = $quote->getTotals();
$total = $quote->getSubtotal();
if ($configHelper->getconfig('order/include_discount')) {
if (isset($totals['discount'])) {
$shippingTotal = $totals['discount']->getValue();
$total += $shippingTotal;
}
}
if ($configHelper->getconfig('order/include_shipping')) {
if (isset($totals['shipping'])) {
$shippingTotal = $totals['shipping']->getValue();
$total += $shippingTotal;
}
}
if ($configHelper->getconfig('order/include_tax')) {
if (isset($totals['tax'])) {
$taxTotal = $totals['tax']->getValue();
$total += $taxTotal;
}
}
$body->setTotal($dataHelper->getAsStoreCurrency($total));
}
示例4: _filterQuote
/**
* @param Mage_Sales_Model_Quote $quote
*
* @return Bronto_Common_Model_Email_Template_Filter
*/
protected function _filterQuote(Mage_Sales_Model_Quote $quote)
{
if (!in_array('quote', $this->_filteredObjects)) {
$this->setStoreId($quote->getStoreId());
$currencyCode = $quote->getQuoteCurrencyCode();
if (Mage::helper('bronto_common')->displayPriceIncTax($quote->getStoreId())) {
$totals = $quote->getTotals();
$this->setField('subtotal', $this->formatPrice($totals['subtotal']->getValue(), $currencyCode));
$this->setField('grandTotal', $this->formatPrice($totals['grand_total']->getValue(), $currencyCode));
} else {
$this->setField('subtotal', $this->formatPrice($quote->getSubtotal(), $currencyCode));
$this->setField('grandTotal', $this->formatPrice($quote->getGrandTotal(), $currencyCode));
}
$index = 1;
foreach ($quote->getAllItems() as $item) {
if (!$item->getParentItem()) {
$this->_filterQuoteItem($item, $index);
$index++;
}
}
// Add Related Content
$this->_items = $quote->getAllItems();
$queryParams = $this->getQueryParams();
$queryParams['id'] = urlencode(base64_encode(Mage::helper('core')->encrypt($quote->getId())));
if ($store = $this->getStore()) {
$this->setField('quoteURL', $store->getUrl('reminder/load/index', $queryParams));
} else {
$this->setField('quoteURL', Mage::getUrl('reminder/load/index', $queryParams));
}
// Setup quote items as a template
if (class_exists('Bronto_Reminder_Block_Cart_Items', false)) {
$layout = Mage::getSingleton('core/layout');
/* @var $items Mage_Sales_Block_Items_Abstract */
$items = $layout->createBlock('bronto/bronto_reminder_cart_items', 'items');
$items->setTemplate('bronto/reminder/items.phtml');
$items->setQuote($item->getQuote());
$this->_respectDesignTheme();
$this->setField("cartItems", $items->toHtml());
}
$this->_filteredObjects[] = 'quote';
}
return $this;
}