本文整理汇总了PHP中Mage_Sales_Model_Quote_Address_Total_Abstract类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote_Address_Total_Abstract类的具体用法?PHP Mage_Sales_Model_Quote_Address_Total_Abstract怎么用?PHP Mage_Sales_Model_Quote_Address_Total_Abstract使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Sales_Model_Quote_Address_Total_Abstract类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: collect
/**
* @param Mage_Sales_Model_Quote_Address $address
*
* @return $this|Mage_Sales_Model_Quote_Address_Total_Abstract
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
if (Mage::helper("shopgate/config")->getIsMagentoVersionLower1410()) {
$items = $address->getAllItems();
} else {
$items = $this->_getAddressItems($address);
}
$shopgateOrder = Mage::getSingleton("core/session")->getData("shopgate_order");
if (!count($items) || is_null($shopgateOrder)) {
return $this;
//this makes only address type shipping to come through
}
$quote = $address->getQuote();
$amountShopPayment = $shopgateOrder->getAmountShopPayment();
if ($amountShopPayment >= 0) {
return $this;
}
$address->setShopgatePaymentFee($amountShopPayment);
$address->setBaseShopgatePaymentFee($amountShopPayment);
$quote->setShopgatePaymentFee($amountShopPayment);
$quote->setBaseShopgatePaymentFee($amountShopPayment);
$address->setGrandTotal($address->getGrandTotal() + $address->getShopgatePaymentFee());
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseShopgatePaymentFee());
return $this;
}
开发者ID:buttasg,项目名称:cowgirlk,代码行数:31,代码来源:ShopgatePaymentFee.php
示例2: collect
/**
* @param Mage_Sales_Model_Quote_Address $address
* @return Mage_Sales_Model_Quote_Address_Total_Abstract
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
$quote = $address->getQuote();
$payment = $quote->getPayment();
if ($address->getAddressType() === 'billing') {
return $this;
}
$configId = $payment->getPayoneConfigPaymentMethodId();
if (empty($configId)) {
return $this;
}
$config = $this->helperConfig()->getConfigPaymentMethodById($configId, $quote->getStoreId());
if (empty($config)) {
return $this;
}
$feeConfig = $config->getFeeConfigForQuote($quote);
if (!is_array($feeConfig) or !array_key_exists('fee_config', $feeConfig)) {
return $this;
}
$paymentFee = $feeConfig['fee_config'];
$oldShippingAmount = $address->getBaseShippingAmount();
$newShippingAmount = $oldShippingAmount + $paymentFee;
$address->setBaseShippingAmount($newShippingAmount);
$address->setShippingAmount($quote->getStore()->convertPrice($newShippingAmount, false));
return parent::collect($address);
}
开发者ID:kirchbergerknorr,项目名称:payone-magento,代码行数:30,代码来源:Fee.php
示例3: collect
/**
* Collect Weee taxes amount and prepare items prices for taxation and discount
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Mage_Weee_Model_Total_Quote_Weee
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
Mage_Sales_Model_Quote_Address_Total_Abstract::collect($address);
$this->_isTaxAffected = false;
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
}
$address->setAppliedTaxesReset(true);
$address->setAppliedTaxes(array());
$this->_store = $address->getQuote()->getStore();
$this->_helper->setStore($this->_store);
foreach ($items as $item) {
if ($item->getParentItemId()) {
continue;
}
$this->_resetItemData($item);
if ($item->getHasChildren() && $item->isChildrenCalculated()) {
foreach ($item->getChildren() as $child) {
$this->_resetItemData($child);
$this->_process($address, $child);
}
$this->_recalculateParent($item);
} else {
$this->_process($address, $item);
}
}
if ($this->_isTaxAffected) {
$address->unsSubtotalInclTax();
$address->unsBaseSubtotalInclTax();
}
return $this;
}
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:39,代码来源:Weee.php
示例4: collect
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
$address->setBaseSubscriptionInitAmount(0);
$address->setSubscriptionInitAmount(0);
$this->_setAddress($address);
$this->_setAmount(0);
$this->_setBaseAmount(0);
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
}
$quote = $address->getQuote();
$baseInitAmount = $this->getInitAmount($quote);
$initAmount = $address->getQuote()->getStore()->convertPrice($baseInitAmount, false);
if (!Mage::registry('customweb_subscription_recurring_order') && $baseInitAmount) {
$address->setBaseSubscriptionInitAmount($baseInitAmount);
$address->setSubscriptionInitAmount($initAmount);
$quote->setBaseSubscriptionInitAmount($baseInitAmount);
$quote->setSubscriptionInitAmount($initAmount);
$address->setGrandTotal($address->getGrandTotal() + $initAmount);
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $initAmount);
$this->_calculateTax($address);
}
}
开发者ID:xiaoguizhidao,项目名称:extensiongsd,代码行数:25,代码来源:InitAmount.php
示例5: collect
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
// Makes sure you only use the address type shipping
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
}
// reset totals by default (needed for some external checkout modules)
$address->setPaymentFeeAmount(0);
$address->setBasePaymentFeeAmount(0);
$adyenFeeHelper = Mage::helper('adyen_fee');
$this->_setAmount(0);
$this->_setBaseAmount(0);
$quote = $address->getQuote();
$val = $adyenFeeHelper->isPaymentFeeEnabled($quote);
if ($address->getAllItems() && $val) {
$basePaymentFee = $adyenFeeHelper->getPaymentFeeExclVat($address);
if ($basePaymentFee) {
$address->setPaymentFeeAmount($address->getQuote()->getStore()->convertPrice($basePaymentFee));
$address->setBasePaymentFeeAmount($basePaymentFee);
$address->setGrandTotal($address->getGrandTotal() + $address->getPaymentFeeAmount());
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBasePaymentFeeAmount());
}
}
return $this;
}
开发者ID:Maikel-Koek,项目名称:magento,代码行数:27,代码来源:PaymentFee.php
示例6: collect
public function collect(Mage_Sales_Model_Quote_Address $address)
{
if ($address->getQuote()->isVirtual()) {
if ($address->getData('address_type') == 'shipping') {
return $this;
}
} else {
if ($address->getData('address_type') == 'billing') {
return $this;
}
}
$this->_setAddress($address);
parent::collect($address);
$quote = $address->getQuote();
$amount = $quote->getMundipaggInterest();
if ($amount > 0) {
$this->_setBaseAmount(0.0);
$this->_setAmount(0.0);
$quote->getPayment()->setPaymentInterest($amount);
$address->setMundipaggInterest($amount);
$this->_setBaseAmount($amount);
$this->_setAmount($amount);
} else {
$this->_setBaseAmount(0.0);
$this->_setAmount(0.0);
$quote->getPayment()->setPaymentInterest(0.0);
$address->setMundipaggInterest(0.0);
}
return $this;
}
开发者ID:rorteg,项目名称:rafaelmage,代码行数:30,代码来源:Interest.php
示例7: collect
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
$address->setDamageWaiverAmount(0);
$address->setBaseDamageWaiverAmount(0);
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
//this makes only address type shipping to come through
}
$quote = $address->getQuote();
$quote->setDamageWaiverAmount(0);
$depositAmt = ITwebexperts_Payperrentals_Helper_Price::getQuoteDamageWaiver($quote);
if ($depositAmt > 0) {
$exist_amount = $quote->getDamageWaiverAmount();
$fee = $depositAmt;
$balance = $fee - $exist_amount;
$address->setDamageWaiverAmount($balance);
$address->setBaseDamageWaiverAmount($balance);
$quote->setDamageWaiverAmount($balance);
} else {
$address->setDamageWaiverAmount(0);
$address->setBaseDamageWaiverAmount(0);
$quote->setDamageWaiverAmount(0);
}
return $this;
}
开发者ID:hueyl77,项目名称:fourwindsgear,代码行数:27,代码来源:Damagewaiver.php
示例8: collect
/**
* Collect totals information about shipping
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Mage_Sales_Model_Quote_Address_Total_Shipping
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
$calc = $this->_calculator;
$store = $address->getQuote()->getStore();
$storeTaxRequest = $calc->getRateOriginRequest($store);
$addressTaxRequest = $calc->getRateRequest($address, $address->getQuote()->getBillingAddress(), $address->getQuote()->getCustomerTaxClassId(), $store);
$storeTaxRequest->setProductClassId($this->_config->getShippingTaxClass($store));
$addressTaxRequest->setProductClassId($this->_config->getShippingTaxClass($store));
$this->_areTaxRequestsSimilar = $calc->compareRequests($addressTaxRequest, $storeTaxRequest);
$shipping = $taxShipping = $address->getShippingAmount();
$baseShipping = $baseTaxShipping = $address->getBaseShippingAmount();
$rate = $calc->getRate($addressTaxRequest);
if ($this->_config->shippingPriceIncludesTax($store)) {
if ($this->_areTaxRequestsSimilar) {
$tax = $this->_round($calc->calcTaxAmount($shipping, $rate, true, false), $rate, true);
$baseTax = $this->_round($calc->calcTaxAmount($baseShipping, $rate, true, false), $rate, true, 'base');
$taxShipping = $shipping;
$baseTaxShipping = $baseShipping;
$shipping = $shipping - $tax;
$baseShipping = $baseShipping - $baseTax;
$taxable = $taxShipping;
$baseTaxable = $baseTaxShipping;
$isPriceInclTax = true;
} else {
$storeRate = $calc->getStoreRate($addressTaxRequest, $store);
$storeTax = $calc->calcTaxAmount($shipping, $storeRate, true, false);
$baseStoreTax = $calc->calcTaxAmount($baseShipping, $storeRate, true, false);
$shipping = $calc->round($shipping - $storeTax);
$baseShipping = $calc->round($baseShipping - $baseStoreTax);
$tax = $this->_round($calc->calcTaxAmount($shipping, $rate, false, false), false, $rate);
$baseTax = $this->_round($calc->calcTaxAmount($baseShipping, $rate, false, false), $rate, false, 'base');
$taxShipping = $shipping + $tax;
$baseTaxShipping = $baseShipping + $baseTax;
$taxable = $shipping;
$baseTaxable = $baseShipping;
$isPriceInclTax = false;
}
} else {
$tax = $this->_round($calc->calcTaxAmount($shipping, $rate, false, false), false, $rate);
$baseTax = $this->_round($calc->calcTaxAmount($baseShipping, $rate, false, false), $rate, false, 'base');
$taxShipping = $shipping + $tax;
$baseTaxShipping = $baseShipping + $baseTax;
$taxable = $shipping;
$baseTaxable = $baseShipping;
$isPriceInclTax = false;
}
$address->setTotalAmount('shipping', $shipping);
$address->setBaseTotalAmount('shipping', $baseShipping);
$address->setShippingInclTax($taxShipping);
$address->setBaseShippingInclTax($baseTaxShipping);
$address->setShippingTaxable($taxable);
$address->setBaseShippingTaxable($baseTaxable);
$address->setIsShippingInclTax($isPriceInclTax);
if ($this->_config->discountTax($store)) {
$address->setShippingAmountForDiscount($taxShipping);
$address->setBaseShippingAmountForDiscount($baseTaxShipping);
}
return $this;
}
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:66,代码来源:Shipping.php
示例9: collect
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
$this->_setAmount(0);
$this->_setBaseAmount(0);
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
//this makes only address type shipping to come through
}
$quote = $address->getQuote();
if (Excellence_Fee_Model_Fee::canApply($address)) {
$exist_amount = $quote->getFeeAmount();
$fee = Excellence_Fee_Model_Fee::getFee();
$balance = $fee - $exist_amount;
// $balance = $fee;
//$this->_setAmount($balance);
//$this->_setBaseAmount($balance);
$address->setFeeAmount($balance);
$address->setBaseFeeAmount($balance);
$quote->setFeeAmount($balance);
$address->setGrandTotal($address->getGrandTotal() + $address->getFeeAmount());
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseFeeAmount());
}
}
开发者ID:jacekelgda,项目名称:Magento,代码行数:25,代码来源:Fee.php
示例10: collect
/**
* Collect address discount amount
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Mage_SalesRule_Model_Quote_Discount
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
$quote = $address->getQuote();
$store = Mage::app()->getStore($quote->getStoreId());
$this->_calculator->reset($address);
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
}
$eventArgs = array('website_id' => $store->getWebsiteId(), 'customer_group_id' => $quote->getCustomerGroupId(), 'coupon_code' => $quote->getCouponCode());
$this->_calculator->init($store->getWebsiteId(), $quote->getCustomerGroupId(), $quote->getCouponCode());
$this->_calculator->initTotals($items, $address);
$address->setDiscountDescription(array());
$items = $this->_calculator->sortItemsByPriority($items);
foreach ($items as $item) {
if ($item->getNoDiscount()) {
$item->setDiscountAmount(0);
$item->setBaseDiscountAmount(0);
} else {
/**
* Child item discount we calculate for parent
*/
if ($item->getParentItemId()) {
continue;
}
$eventArgs['item'] = $item;
Mage::dispatchEvent('sales_quote_address_discount_item', $eventArgs);
if ($item->getHasChildren() && $item->isChildrenCalculated()) {
foreach ($item->getChildren() as $child) {
$this->_calculator->process($child);
$eventArgs['item'] = $child;
Mage::dispatchEvent('sales_quote_address_discount_item', $eventArgs);
$this->_aggregateItemDiscount($child);
}
} else {
$this->_calculator->process($item);
$this->_aggregateItemDiscount($item);
}
}
}
/**
* process weee amount
*/
if (Mage::helper('weee')->isEnabled() && Mage::helper('weee')->isDiscounted($store)) {
$this->_calculator->processWeeeAmount($address, $items);
}
/**
* Process shipping amount discount
*/
$address->setShippingDiscountAmount(0);
$address->setBaseShippingDiscountAmount(0);
if ($address->getShippingAmount()) {
$this->_calculator->processShippingAmount($address);
$this->_addAmount(-$address->getShippingDiscountAmount());
$this->_addBaseAmount(-$address->getBaseShippingDiscountAmount());
}
$this->_calculator->prepareDescription($address);
return $this;
}
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:66,代码来源:Discount.php
示例11: fetch
public function fetch(Mage_Sales_Model_Quote_Address $address)
{
$_result = parent::fetch($address);
$giftCards = Mage::helper('aw_giftcard/totals')->getQuoteGiftCards($address->getQuote()->getId());
$address->addTotal(array('code' => $this->getCode(), 'title' => Mage::helper('aw_giftcard')->__('Gift Cards'), 'value' => -$address->getAwGiftCardsAmount(), 'gift_cards' => $giftCards));
return $_result;
}
开发者ID:buttasg,项目名称:cowgirlk,代码行数:7,代码来源:Quote.php
示例12: collect
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
// Makes sure you only use the address type shipping
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
}
// reset totals by default (needed for onestepcheckout module)
$address->setPaymentPercentageFee(0);
$address->setBasePaymentPercentageFee(0);
$quote = $address->getQuote();
$adyenFeeHelper = Mage::helper('adyen_fee');
$paymentMethod = $quote->getPayment()->getMethod();
$percentageFee = $adyenFeeHelper->getHppPaymentMethodPercentageFee($paymentMethod);
if (!$percentageFee) {
return $this;
}
// minus the payment method fee inclusief tax if both are set
$paymentMethodFee = $address->getPaymentFeeAmount();
$paymentMethodFeeTax = $address->getPaymentFeeTax();
$grandTotal = $address->getGrandTotal() - ($paymentMethodFee + $paymentMethodFeeTax);
$fee = $address->getGrandTotal() / 100 * $percentageFee;
$grandTotal = $address->getGrandTotal();
$baseGrandTotal = $address->getBaseGrandTotal();
$address->setPaymentPercentageFee($address->getQuote()->getStore()->convertPrice($fee));
$address->setBasePaymentPercentageFee($fee);
$address->setGrandTotal($grandTotal + $address->getPaymentPercentageFee());
$address->setBaseGrandTotal($baseGrandTotal + $address->getBasePaymentPercentageFee());
return $this;
}
开发者ID:Maikel-Koek,项目名称:magento,代码行数:31,代码来源:PaymentPercentageFee.php
示例13: collect
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
if ($address->getAddressType() != "shipping") {
return $this;
}
$this->address = $address;
$this->_resetValues();
if ($this->address->getQuote()->getId() == null) {
return $this;
}
$items = $this->address->getAllItems();
if (!count($items)) {
return $this;
}
$payment = $this->address->getQuote()->getPayment();
try {
$this->paymentMethod = $payment->getMethodInstance();
} catch (Mage_Core_Exception $e) {
return $this;
}
if (!$this->paymentMethod instanceof Mage_Payment_Model_Method_Abstract) {
return $this;
}
if ($this->paymentMethod->getCode() === 'billmateinvoice') {
$this->_initInvoiceFee();
}
return $this;
}
开发者ID:ext,项目名称:magento,代码行数:29,代码来源:Total.php
示例14: collect
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
$page = $_SERVER['REQUEST_URI'];
$onepage = "checkout/cart";
$onepagecheck = strpos($page, $onepage);
if ($onepagecheck !== false) {
return $this;
}
$this->_setAmount(0);
$this->_setBaseAmount(0);
if (count($address->getAllItems()) == 0) {
return $this;
}
$quote = $address->getQuote();
$payment = $quote->getPayment();
try {
$method = $payment->getMethodInstance();
} catch (Mage_Core_Exception $e) {
return $this;
}
if ($method->getCode() != 'billmateinvoice') {
return $this;
}
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
//this makes only address type shipping to come through
}
$invoiceFee = $baseInvoiceFee = Mage::helper('billmateinvoice')->replaceSeparator(Mage::getStoreConfig('payment/billmateinvoice/billmate_fee'));
$exist_amount = $quote->getFeeAmount();
if (Mage::getStoreConfig('payment/billmateinvoice/tax_class')) {
$data = Mage::helper('billmateinvoice')->getInvoiceFeeArray($invoiceFee, $address, $quote->getCustomerTaxClassId());
$invoiceFee = $data['base_incl'];
}
$this->_calculator = Mage::getSingleton('tax/calculation');
$calc = $this->_calculator;
$store = $address->getQuote()->getStore();
$addressTaxRequest = $calc->getRateRequest($address->getQuote()->getShippingAddress(), $address->getQuote()->getBillingAddress(), $address->getQuote()->getCustomerTaxClassId(), $store);
$paymentTaxClass = Mage::getStoreConfig('payment/billmateinvoice/tax_class');
$addressTaxRequest->setProductClassId($paymentTaxClass);
$rate = $calc->getRate($addressTaxRequest);
$taxAmount = $calc->calcTaxAmount($baseInvoiceFee, $rate, false, true);
$baseTaxAmount = $calc->calcTaxAmount($baseInvoiceFee, $rate, false, true);
$address->setPaymentTaxAmount($taxAmount);
$address->setBasePaymentTaxAmount($baseTaxAmount);
//
$address->setTaxAmount($address->getTaxAmount() + $taxAmount);
$address->setBaseTaxAmount($address->getBaseTaxAmount() + $baseTaxAmount);
/* clime: tax calculation end */
$address->setFeeAmount($baseInvoiceFee);
$address->setBaseFeeAmount($baseInvoiceFee);
$address->setFeeTaxAmount($taxAmount);
$address->setBaseFeeTaxAmount($baseTaxAmount);
$totInv = $baseInvoiceFee + $taxAmount;
$quote->setFeeAmount($baseInvoiceFee + $taxAmount);
$quote->setFeeTaxAmount($taxAmount);
$address->setGrandTotal($address->getGrandTotal() + $address->getBaseFeeAmount());
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseFeeAmount());
}
开发者ID:ext,项目名称:magento,代码行数:60,代码来源:Fee.php
示例15: collect
public function collect(Mage_Sales_Model_Quote_Address $address)
{
$totalItems = Mage::helper('checkout/cart')->getSummaryCount();
parent::collect($address);
$this->_setAmount(0);
$this->_setBaseAmount(0);
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
}
$quote = $address->getQuote();
$exist_amount = $quote->getFeeAmount();
$cod = Mage::helper("emipro_codpayment")->cod_charges($quote);
$fee = $cod["fees"];
$balance = $fee - $exist_amount;
try {
$balance = $balance / $totalItems;
} catch (Exception $e) {
}
if ($quote->getPayment()->getMethod() == "cashondelivery") {
$baseCurrencyCode = $quote->getBaseCurrencyCode();
$currentCurrencyCode = $quote->getQuoteCurrencyCode();
$CodChange = Mage::helper('directory')->currencyConvert($balance, $baseCurrencyCode, $currentCurrencyCode);
$address->setFeeAmount($CodChange);
$address->setBaseFeeAmount($balance);
$address->setGrandTotal($address->getGrandTotal() + $address->getFeeAmount());
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseFeeAmount());
}
}
开发者ID:axovel,项目名称:exqzt,代码行数:29,代码来源:Codpayment.php
示例16: collect
/**
* Collect totals information about insurance
*
* @param Mage_Sales_Model_Quote_Address $address
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
$this->_setAmount(0);
$this->_setBaseAmount(0);
if ($address->getAddressType() == 'billing') {
return $this;
}
$helper = Mage::helper('referralreward');
$points = (int) Mage::getSingleton('core/session')->getPointsDiscount();
//if ($points) {
$quote = $address->getQuote();
$exist_amount = $quote->getReferralrewardAmount();
$amount = -1 * $helper->convertPoints($points);
//if ($amount != 0) {
$balance = $amount - $exist_amount;
$address->setReferralrewardAmount($balance);
$address->setBaseReferralrewardAmount($balance);
$quote->setReferralrewardAmount($balance);
$address->setGrandTotal($address->getGrandTotal() + $address->getReferralrewardAmount());
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseReferralrewardAmount());
//}
//}
/*if ($amount) {
$this->_addAmount($amount);
$this->_addBaseAmount($amount);
}*/
return $this;
}
开发者ID:bigtailbear14,项目名称:rosstheme,代码行数:34,代码来源:Belvg_Referralreward_Model_Total_Quote.php
示例17: collect
/**
* Collect gift wrapping totals
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Enterprise_GiftWrapping_Model_Total_Quote_Giftwrapping
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
if ($address->getAddressType() != Mage_Sales_Model_Quote_Address::TYPE_SHIPPING) {
return $this;
}
$this->_quote = $address->getQuote();
$this->_store = $this->_quote->getStore();
$quote = $this->_quote;
if ($quote->getIsMultiShipping()) {
$this->_quoteEntity = $address;
} else {
$this->_quoteEntity = $quote;
}
$this->_collectWrappingForItems($address)->_collectWrappingForQuote($address)->_collectPrintedCard($address);
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getGwItemsBasePrice() + $address->getGwBasePrice() + $address->getGwCardBasePrice());
$address->setGrandTotal($address->getGrandTotal() + $address->getGwItemsPrice() + $address->getGwPrice() + $address->getGwCardPrice());
if ($quote->getIsNewGiftWrappingCollecting()) {
$quote->setGwItemsBasePrice(0);
$quote->setGwItemsPrice(0);
$quote->setGwBasePrice(0);
$quote->setGwPrice(0);
$quote->setGwCardBasePrice(0);
$quote->setGwCardPrice(0);
$quote->setIsNewGiftWrappingCollecting(false);
}
$quote->setGwItemsBasePrice($address->getGwItemsBasePrice() + $quote->getGwItemsBasePrice());
$quote->setGwItemsPrice($address->getGwItemsPrice() + $quote->getGwItemsPrice());
$quote->setGwBasePrice($address->getGwBasePrice() + $quote->getGwBasePrice());
$quote->setGwPrice($address->getGwPrice() + $quote->getGwPrice());
$quote->setGwCardBasePrice($address->getGwCardBasePrice() + $quote->getGwCardBasePrice());
$quote->setGwCardPrice($address->getGwCardPrice() + $quote->getGwCardPrice());
return $this;
}
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:40,代码来源:Giftwrapping.php
示例18: collect
/**
* Collect fee address amount
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Brander_PaymentFee_Model_Sales_Quote_Address_Total_Fee
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
$this->_setAmount(0);
$this->_setBaseAmount(0);
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
}
/* @var $quote Mage_Sales_Model_Quote */
$quote = $address->getQuote();
/* @var $feeModel Brander_PaymentFee_Model_Fee */
$feeModel = Mage::getModel('payment_fee/fee');
if ($feeModel->canApply($address)) {
$exist_amount = $quote->getFeeAmount();
$fee = $feeModel->getFee($address);
$balance = $fee - $exist_amount;
$address->setFeeAmount($balance);
$address->setBaseFeeAmount($balance);
$quote->setFeeAmount($balance);
$address->setGrandTotal($address->getGrandTotal() + $address->getFeeAmount());
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseFeeAmount());
}
return $this;
}
开发者ID:kirchbergerknorr,项目名称:payment-fee,代码行数:31,代码来源:Fee.php
示例19: collect
/**
* Collect totals information about insurance
*
* @param Mage_Sales_Model_Quote_Address $address
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
if ($address->getAddressType() == 'billing') {
return $this;
}
$amount = number_format($address->getQuote()->getGiftCardValue(), 2);
$this->_totaldiscountpay = $amount;
$items = $this->_getAddressItems($address);
if (!count($items)) {
return $this;
}
$this->initTotals($items, $address);
foreach ($items as $item) {
if ($item->getParentItemId()) {
continue;
}
if ($item->getHasChildren() && $item->isChildrenCalculated()) {
foreach ($item->getChildren() as $child) {
$this->process($child);
$this->_aggregateItemDiscount($child);
}
} else {
$this->process($item);
$this->_aggregateItemDiscount($item);
}
}
$address->setBaseGrandTotal($address->getBaseGrandTotal() - $amount);
$address->setGrandTotal($address->getGrandTotal() - $amount);
return $this;
}
开发者ID:shakhawat4g,项目名称:MagentoExtensions,代码行数:36,代码来源:Discount.php
示例20: collect
/**
* Collect address subtotal
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Mage_Sales_Model_Quote_Address_Total_Subtotal
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
parent::collect($address);
$address->setTotalQty(0);
$baseVirtualAmount = $virtualAmount = 0;
/**
* Process address items
*/
$items = $this->_getAddressItems($address);
foreach ($items as $item) {
if ($this->_initItem($address, $item) && $item->getQty() > 0) {
/**
* Separatly calculate subtotal only for virtual products
*/
if ($item->getProduct()->isVirtual()) {
$virtualAmount += $item->getRowTotal();
$baseVirtualAmount += $item->getBaseRowTotal();
}
} else {
$this->_removeItem($address, $item);
}
}
$address->setBaseVirtualAmount($baseVirtualAmount);
$address->setVirtualAmount($virtualAmount);
/**
* Initialize grand totals
*/
Mage::helper('sales')->checkQuoteAmount($address->getQuote(), $address->getSubtotal());
Mage::helper('sales')->checkQuoteAmount($address->getQuote(), $address->getBaseSubtotal());
return $this;
}
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:37,代码来源:Subtotal.php
注:本文中的Mage_Sales_Model_Quote_Address_Total_Abstract类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论