当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Sales_Model_Quote_Address::getBaseTaxAmount方法代码示例

本文整理汇总了PHP中Mage_Sales_Model_Quote_Address::getBaseTaxAmount方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote_Address::getBaseTaxAmount方法的具体用法?PHP Mage_Sales_Model_Quote_Address::getBaseTaxAmount怎么用?PHP Mage_Sales_Model_Quote_Address::getBaseTaxAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Sales_Model_Quote_Address的用法示例。


在下文中一共展示了Mage_Sales_Model_Quote_Address::getBaseTaxAmount方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: collect

 /**
  * Collect the order total
  *
  * @param object $address The address instance to collect from
  *
  * @return Sisow_Model_Quote_TaxTotal
  */
 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $quote = $address->getQuote();
     if ($quote->getId() == null || $address->getAddressType() != "shipping") {
         return $this;
     }
     $payment = $quote->getPayment();
     if (substr($payment->getMethod(), 0, 6) != 'sisow_' && (!count($quote->getPaymentsCollection()) || !$payment->hasMethodInstance())) {
         return $this;
     }
     $methodInstance = $payment->getMethodInstance();
     if (substr($methodInstance->getCode(), 0, 6) != 'sisow_') {
         return $this;
     }
     $helper = Mage::helper('sisow/paymentfee');
     $fee = $helper->getPaymentFeeArray($methodInstance->getCode(), $quote);
     if (!is_array($fee)) {
         return $this;
     }
     $address->setTaxAmount($address->getTaxAmount() + $fee['taxamount']);
     $address->setBaseTaxAmount($address->getBaseTaxAmount() + $fee['base_taxamount']);
     $address->setInvoiceTaxAmount($fee['taxamount']);
     $address->setBaseInvoiceTaxAmount($fee['base_taxamount']);
     return $this;
 }
开发者ID:wouter90,项目名称:sisowpayment,代码行数:32,代码来源:TaxTotal.php

示例2: addressToOrder

 /**
  * Convert quote address model to order
  *
  * @param   Mage_Sales_Model_Quote $quote
  * @return  Mage_Sales_Model_Order
  */
 public function addressToOrder(Mage_Sales_Model_Quote_Address $address, $order = null)
 {
     if (!$order instanceof Mage_Sales_Model_Order) {
         $order = $this->toOrder($address->getQuote());
     }
     $order->setWeight($address->getWeight())->setShippingMethod($address->getShippingMethod())->setShippingDescription($address->getShippingDescription())->setShippingRate($address->getShippingRate())->setSubtotal($address->getSubtotal())->setTaxAmount($address->getTaxAmount())->setDiscountAmount($address->getDiscountAmount())->setShippingAmount($address->getShippingAmount())->setGiftcertAmount($address->getGiftcertAmount())->setCustbalanceAmount($address->getCustbalanceAmount())->setGrandTotal($address->getGrandTotal())->setBaseSubtotal($address->getBaseSubtotal())->setBaseTaxAmount($address->getBaseTaxAmount())->setBaseDiscountAmount($address->getBaseDiscountAmount())->setBaseShippingAmount($address->getBaseShippingAmount())->setBaseGiftcertAmount($address->getBaseGiftcertAmount())->setBaseCustbalanceAmount($address->getBaseCustbalanceAmount())->setBaseGrandTotal($address->getBaseGrandTotal());
     Mage::dispatchEvent('sales_convert_quote_address_to_order', array('address' => $address, 'order' => $order));
     return $order;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:15,代码来源:Quote.php

示例3: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $store = $address->getQuote()->getStore();
     $address->setTaxAmount(0);
     $address->setBaseTaxAmount(0);
     $tax = Mage::getModel('tax/rate_data')->setCustomerClassId($address->getQuote()->getCustomerTaxClassId());
     /* @var $tax Mage_Tax_Model_Rate_Data */
     $taxAddress = $address;
     switch (Mage::getStoreConfig('sales/tax/based_on')) {
         case 'billing':
             $taxAddress = $address->getQuote()->getBillingAddress();
         case 'shipping':
             $tax->setCountryId($taxAddress->getCountryId())->setRegionId($taxAddress->getRegionId())->setPostcode($taxAddress->getPostcode());
             break;
         case 'origin':
             $tax->setCountryId(Mage::getStoreConfig('shipping/origin/country_id', $store))->setRegionId(Mage::getStoreConfig('shipping/origin/region_id', $store))->setPostcode(Mage::getStoreConfig('shipping/origin/postcode', $store));
             break;
     }
     foreach ($address->getAllItems() as $item) {
         $tax->setProductClassId($item->getProduct()->getTaxClassId());
         $rate = $tax->getRate();
         $item->setTaxPercent($rate);
         $item->calcTaxAmount();
         $address->setTaxAmount($address->getTaxAmount() + $item->getTaxAmount());
         $address->setBaseTaxAmount($address->getBaseTaxAmount() + $item->getBaseTaxAmount());
     }
     $shippingTaxClass = Mage::getStoreConfig('sales/tax/shipping_tax_class', $store);
     if ($shippingTaxClass) {
         $tax->setProductClassId($shippingTaxClass);
         if ($rate = $tax->getRate()) {
             $shippingTax = $address->getShippingAmount() * $rate / 100;
             $shippingBaseTax = $address->getBaseShippingAmount() * $rate / 100;
             $shippingTax = $store->roundPrice($shippingTax);
             $shippingBaseTax = $store->roundPrice($shippingBaseTax);
             $address->setTaxAmount($address->getTaxAmount() + $shippingTax);
             $address->setBaseTaxAmount($address->getBaseTaxAmount() + $shippingBaseTax);
         }
     }
     $address->setGrandTotal($address->getGrandTotal() + $address->getTaxAmount());
     $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseTaxAmount());
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:42,代码来源:Tax.php

示例4: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $address->setPaymentCharge(0);
     $address->setBasePaymentCharge(0);
     $storeId = Mage::app()->getStore()->getId();
     $items = $address->getAllItems();
     if (!count($items)) {
         return $this;
     }
     $paymentMethod = $address->getQuote()->getPayment()->getMethod();
     $quote = $address->getQuote();
     if ($paymentMethod && substr($paymentMethod, 0, 11) == 'pay_payment') {
         $baseAmount = Mage::helper('pay_payment')->getPaymentCharge($paymentMethod, $address->getQuote());
         $amount = Mage::helper('directory')->currencyConvert($baseAmount, Mage::app()->getWebsite()->getConfig('currency/options/default'), Mage::app()->getStore()->getCurrentCurrencyCode());
         $address->setPaymentCharge($amount);
         $address->setBasePaymentCharge($baseAmount);
         $taxClass = Mage::helper('pay_payment')->getPaymentChargeTaxClass($paymentMethod);
         $taxCalculationModel = Mage::getSingleton('tax/calculation');
         $request = $taxCalculationModel->getRateRequest($quote->getShippingAddress(), $quote->getBillingAddress(), null, $storeId);
         $request->setStore(Mage::app()->getStore());
         $rate = $taxCalculationModel->getRate($request->setProductClassId($taxClass));
         //$rate = 21;
         if ($rate > 0) {
             //                $includesTax = Mage::getStoreConfig('tax/calculation/price_includes_tax');
             $baseChargeTax = round($address->getBasePaymentCharge() / (1 + $rate / 100) * ($rate / 100), 2);
             $chargeTax = round($address->getPaymentCharge() / (1 + $rate / 100) * ($rate / 100), 2);
         } else {
             $baseChargeTax = 0;
             $chargeTax = 0;
         }
         $rates = array();
         $applied = false;
         foreach ($address->getAppliedTaxes() as $arrRate) {
             // maximaal 1 keer de btw voor de extra kosten toevoegen
             if ($arrRate['percent'] == $rate && !$applied) {
                 $applied = true;
                 $arrRate['amount'] = $arrRate['amount'] + $chargeTax;
                 $arrRate['base_amount'] = $arrRate['base_amount'] + $baseChargeTax;
             }
             $rates[] = $arrRate;
         }
         $address->setAppliedTaxes($rates);
         $address->setBaseTaxAmount($address->getBaseTaxAmount() + $baseChargeTax);
         $address->setTaxAmount($address->getTaxAmount() + $chargeTax);
         $address->setGrandTotal($address->getGrandTotal() + $address->getPaymentCharge());
         $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBasePaymentCharge());
     }
     return $this;
 }
开发者ID:paynl,项目名称:magento-plugin,代码行数:49,代码来源:Paymentcharge.php

示例5: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     if (!Mage::getSingleton('checkout/session')->getQuoteId()) {
         return $this;
     }
     $_helper = Mage::helper('msp_cashondelivery');
     $_model = Mage::getModel('msp_cashondelivery/cashondelivery');
     $_subtotal = $address->getSubtotal();
     $quote = $address->getQuote();
     $baseAmount = $_model->getBaseExtraFee($_subtotal);
     $amount = $_model->getExtraFee($_subtotal);
     $codTax = $_helper->getTaxAmount($amount);
     $codBaseTax = $_helper->getTaxAmount($baseAmount);
     if ($quote->getPayment()->getMethod() == $_model->getCode() && $address->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_SHIPPING) {
         $address->setTaxAmount($address->getTaxAmount() + $codTax);
         $address->setBaseTaxAmount($address->getBaseTaxAmount() + $codBaseTax);
         $this->_saveAppliedTaxes($address, $_helper->getAppliedRates(), $codTax, $codBaseTax, $_helper->getRate());
         $address->setGrandTotal($address->getGrandTotal() + $codTax);
         $address->setBaseGrandTotal($address->getBaseGrandTotal() + $codBaseTax);
     }
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:bilderrahmen,代码行数:22,代码来源:Tax.php

示例6: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $store = $address->getQuote()->getStore();
     $session = Mage::getSingleton('checkout/session');
     $discount = $session->getData('webpos_admin_discount');
     if (!$discount) {
         return $this;
     }
     $items = $address->getAllItems();
     if (!count($items)) {
         return $this;
     }
     $session->setData('webpos_admin_discount', $discount);
     $address->setWebposDiscountAmount($discount);
     $address->setData('webpos_discount_amount', $discount);
     /* Daniel - tax for discount */
     $afterDiscount = Mage::getStoreConfig('tax/calculation/apply_after_discount');
     if ($afterDiscount) {
         $country = Mage::getModel('checkout/session')->getQuote()->getShippingAddress()->getCountry();
         $oldTax = $address->getTaxAmount();
         $oldBaseTax = $address->getBaseTaxAmount();
         if ($country) {
             $rateTax = Mage::getModel('tax/calculation_rate')->getCollection()->addFieldToFilter('tax_country_id', $country)->setOrder('rate', 'DESC')->getFirstItem();
             $address->setTaxAmount(($address->getBaseSubtotal() - $discount + $address->getShippingAmount() + $address->getDiscountAmount()) * $rateTax->getRate() / 100)->setBaseTaxAmount(($address->getBaseSubtotal() - $discount + $address->getShippingAmount() + $address->getDiscountAmount()) * $rateTax->getRate() / 100);
             $taxCalculationModel = Mage::getSingleton('tax/calculation');
             $request = Mage::getSingleton('tax/calculation')->getRateRequest($address, $address->getQuote()->getBillingAddress(), $address->getQuote()->getCustomerTaxClassId(), $store);
             $rate = Mage::getSingleton('tax/calculation')->getRate($request);
             $this->_saveAppliedTaxes($address, $taxCalculationModel->getAppliedRates($request), $address->getTaxAmount(), $address->getBaseTaxAmount(), $rate);
         }
         $address->setGrandTotal($address->getGrandTotal() - $address->getWebposDiscountAmount());
         $address->setBaseGrandTotal($address->getBaseGrandTotal() - $address->getWebposDiscountAmount());
     } else {
         $address->setGrandTotal($address->getGrandTotal() - $address->getWebposDiscountAmount());
         $address->setBaseGrandTotal($address->getBaseGrandTotal() - $address->getWebposDiscountAmount());
     }
     /* end */
     return $this;
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:38,代码来源:Discount.php

示例7: fetch

 public function fetch(Mage_Sales_Model_Quote_Address $address)
 {
     $checkoutSubtotal = Mage::getSingleton('checkout/session')->getQuote();
     $items = $address->getAllVisibleItems();
     if (!count($items)) {
         return $this;
     }
     if (!$check_tax) {
         $tax = $address->getBaseTaxAmount();
     }
     if (!$check_shipping) {
         $shipping = $address->getBaseShippingInclTax();
     }
     $baseGrandTotal = $address->getBaseGrandTotal();
     $store_id = Mage::app()->getStore()->getId();
     $quote = $address->getQuote();
     /*added by pavan 28/01/14*/
     $quote->setMwStorecreditCheckoutMax($baseGrandTotal);
     $quote->save();
     //Mage::log('currenturl'.$currentUrl, null, 'mytotal.log');
     //	   Mage::log('pavan is here', null, 'mylogfile.log');
     //	   Mage::log($checkoutSubtotal->getData(), null, 'mylogfile.log');
     //Mage::log('getMwStorecredit'.$address->getMwStorecredit(), null, 'mylogfile.log');
     if ($checkoutSubtotal->getData('subtotal') == $checkoutSubtotal->getData('subtotal_with_discount')) {
         $subTotalWithTax = $checkoutSubtotal->getData('subtotal') + $tax;
     } else {
         $couponAmount = $checkoutSubtotal->getData('subtotal_with_discount') - $checkoutSubtotal->getData('subtotal');
         $subTotalWithTax = $checkoutSubtotal->getData('subtotal_with_discount') + $tax;
     }
     // if($subTotalWithTax >= '500') {
     // $shipp = '0';
     // } else {
     // $shipp = '60';
     // }
     // if($address->getMwStorecredit() > ($subTotalWithTax + $shipp) || $address->getMwRewardpointDiscount() > ($subTotalWithTax + $shipp)) {
     // Mage::log('herere'.$address->getMwStorecredit().$subTotalWithTax, null, 'here123.log');
     // $address->setMwStorecredit(0)
     // ->setMwRewardpoint(0)
     // ->save();
     // $quote->setMwStorecredit(0)
     // ->setMwRewardpoint(0)
     // ->save();
     // }
     /*START -- values set to zero if cart quantity changes*/
     if (Mage::app()->getFrontController()->getRequest()->getActionName() == 'couponapply') {
         $quote = $address->getQuote();
         $quote->setMwStorecredit(0)->setMwStorecreditDiscount(0)->setMwStorecreditDiscountShow(0)->save();
         $quote->setMwRewardpoint(0)->setMwRewardpointDiscountShow(0)->setMwRewardpointDiscount(0)->save();
         $address->setMwStorecredit(0)->setMwStorecreditDiscount(0)->setMwStorecreditDiscountShow(0)->save();
         $address->setMwRewardpoint(0)->setMwRewardpointDiscountShow(0)->setMwRewardpointDiscount(0)->save();
     }
     if (Mage::app()->getFrontController()->getRequest()->getActionName() == 'cartqty' || Mage::app()->getFrontController()->getRequest()->getActionName() == 'delete') {
         $quote = $address->getQuote();
         $quote->setCouponCode('')->setMwStorecredit(0)->setMwStorecreditDiscount(0)->setMwStorecreditDiscountShow(0)->save();
         $quote->setCouponCode('')->setMwRewardpoint(0)->setMwRewardpointDiscountShow(0)->setMwRewardpointDiscount(0)->save();
         $address->setCouponCode('')->setMwStorecredit(0)->setMwStorecreditDiscount(0)->setMwStorecreditDiscountShow(0)->save();
     }
     /*END -- values set to zero if cart quantity changes*/
     $amount = $address->getMwStorecreditDiscountShow();
     $credit = $address->getMwStorecredit();
     if ($credit != 0) {
         $title = Mage::helper('storecreditpro')->__('Zoff Bank');
         $address->addTotal(array('code' => $this->getCode(), 'title' => $title, 'value' => -$credit, 'strong' => false));
     }
     return $this;
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:66,代码来源:Storecredit.php

示例8: 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)
 {
     $helper = Mage::helper('mageworx_multifees');
     if ($address->getSubtotal() == 0 && floatval($address->getCustomerCreditAmount()) == 0) {
         return $this;
     }
     if ($this->_collected) {
         return $this;
     }
     ////////////////////////////////////////////////////////////////////
     $subtotalRowTOTAL = 0;
     $CompanyTotal = 0;
     $PersonTotal = 0;
     $quote = Mage::getSingleton('checkout/cart')->getQuote();
     $cartItems = $quote->getAllVisibleItems();
     $userGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
     foreach ($cartItems as $item) {
         $subtotalRow = 0;
         $_product = Mage::getModel('catalog/product')->load($item->getProductId());
         $ids = $_product->getCategoryIds();
         $productId = $item->getProductId();
         $qty = $item->getQty();
         $price = $item->getProduct()->getPrice();
         $subtotalRow = $subtotalRow + $price * $qty;
         //If the product has perception tax for persons
         if (array_search("372", $ids) != false && $subtotalRow >= 100) {
             $PersonTotal = $PersonTotal + $subtotalRow;
         }
         //If the product has perception tax for persons
         if (array_search("373", $ids) != false) {
             $CompanyTotal = $CompanyTotal + $subtotalRow;
         }
     }
     //If the user is Not log in
     if ($userGroupId == 0 || $userGroupId == 8) {
         $subtotalRowTOTAL = $PersonTotal;
         $subtotalRowTOTAL = $subtotalRowTOTAL / 1.18;
     } elseif ($userGroupId == 8) {
         $subtotalRowTOTAL = $CompanyTotal;
         $subtotalRowTOTAL = $subtotalRowTOTAL / 1.18;
     } else {
         $subtotalRowTOTAL = 0;
     }
     //////////////////////////////////////////////////////////////////////////////////////////////////////
     $baseSubtotalRow = floatval($subtotalRowTOTAL);
     $baseSubtotal = floatval($address->getBaseSubtotalWithDiscount());
     $baseShipping = floatval($address->getBaseShippingAmount());
     // - $address->getBaseShippingTaxAmount()
     $baseTax = floatval($address->getBaseTaxAmount());
     //amount
     $address->setMultifeesAmount(0);
     $address->setBaseMultifeesAmount(0);
     $address->setDetailsMultifees(null);
     $quote = $address->getQuote();
     $feeMessages = new Varien_Data_Collection();
     // add payment fee (front and admin)
     if (Mage::app()->getRequest()->getPost('is_payment_fee', false)) {
         $feesPost = Mage::app()->getRequest()->getPost('fee', array());
         foreach ($feesPost as $feeId => $data) {
             if (isset($data['message'])) {
                 $obj = new Varien_Object();
                 $obj->setFeeId($feeId);
                 $obj->setMessage($data['message']);
                 $feeMessages->addItem($obj);
             }
         }
         $helper->addFeesToCart($feesPost, $quote->getStoreId(), false, 2, 0);
     }
     // add shipping fee (front and admin)
     if (Mage::app()->getRequest()->getPost('is_shipping_fee', false)) {
         $feesPost = Mage::app()->getRequest()->getPost('fee', array());
         foreach ($feesPost as $feeId => $data) {
             if (isset($data['message'])) {
                 $obj = new Varien_Object();
                 $obj->setFeeId($feeId);
                 $obj->setMessage($data['message']);
                 $feeMessages->addItem($obj);
             }
         }
         $helper->addFeesToCart($feesPost, $quote->getStoreId(), false, 3, 0);
     }
     $feesData = $helper->getQuoteDetailsMultifees($address->getId());
     // autoadd default cart fees, no hidden
     if (is_null($feesData) && $helper->isEnableCartFees()) {
         $this->autoAddFeesByParams(1, 0, 2, 1, '', $quote, $address, $helper, null);
     }
     // autoadd hidden cart fees
     if ($helper->isEnableCartFees()) {
         $this->autoAddFeesByParams(1, 0, 1, 1, '', $quote, $address, $helper, null);
     }
     // autoadd hidden shipping fees
     if ($helper->isEnableShippingFees() && $address->getShippingMethod()) {
         $this->autoAddFeesByParams(3, 0, 1, 1, strval($address->getShippingMethod()), $quote, $address, $helper, $feeMessages);
     }
     // autoadd hidden fees
     if ($helper->isEnablePaymentFees() && $quote->getPayment()->getMethod()) {
//.........这里部分代码省略.........
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:101,代码来源:Total.php


注:本文中的Mage_Sales_Model_Quote_Address::getBaseTaxAmount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。