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


PHP Mage_Sales_Model_Quote_Address::getData方法代码示例

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


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

示例1: 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

示例2: initAddress

 /**
  * Set correct values on subscription address based on given subscription and order address
  *
  * @param Adyen_Subscription_Model_Subscription $subscription
  * @param Mage_Sales_Model_Order_Address|Mage_Sales_Model_Quote_Address $address
  * @return $this
  */
 public function initAddress(Adyen_Subscription_Model_Subscription $subscription, $address)
 {
     $this->setSubscriptionId($subscription->getId());
     // Reset (possible) original values
     $this->setOrderAddressId(null)->setCustomerAddressId(null)->setQuoteAddressId(null);
     if ($address->getAddressType() == Mage_Sales_Model_Order_Address::TYPE_BILLING) {
         $this->setType(self::ADDRESS_TYPE_BILLING);
     } else {
         $this->setType(self::ADDRESS_TYPE_SHIPPING);
     }
     // Note: Only use customer address if 'save_in_address_book' or 'same_as_billing'
     // is also checked at the address, because it's not enough to rely solely on the
     // customer address ID, because an address can be changed when creating an order
     // in the backend, but this ID still remains when a quote is converted to an order
     if ($address->getCustomerAddressId() && $address->getData('save_in_address_book')) {
         // Create customer address
         $this->setSource(self::ADDRESS_SOURCE_CUSTOMER)->setCustomerAddressId($address->getCustomerAddressId());
     } elseif ($address instanceof Mage_Sales_Model_Quote_Address) {
         // Create quote address
         $this->setSource(self::ADDRESS_SOURCE_QUOTE)->setQuoteAddressId($address->getId());
     } else {
         // Create order address
         $this->setSource(self::ADDRESS_SOURCE_ORDER)->setOrderAddressId($address->getId());
     }
     return $this;
 }
开发者ID:Adyen,项目名称:adyen-magento-subscription,代码行数:33,代码来源:Address.php

示例3: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $quote = $address->getQuote();
     $session = Mage::getSingleton('checkout/session');
     if (is_null($session->getQuoteId())) {
         $session = Mage::getSingleton('adminhtml/session_quote');
     }
     $isCustomerLoggedIn = (bool) $quote->getCustomer()->getId();
     if ($session->getData('use_points') && $address->getBaseGrandTotal() && $isCustomerLoggedIn) {
         $customer = Mage::getModel('customer/customer')->load($quote->getCustomer()->getId());
         $pointsAmountUsed = abs($session->getData('points_amount'));
         $pointsAmountAllowed = Mage::getModel('points/summary')->loadByCustomer($customer)->getPoints();
         $storeId = $session->getQuote()->getStoreId();
         $website = Mage::app()->getWebsite(Mage::app()->getStore($storeId)->getWebsiteId());
         $baseSubtotalWithDiscount = $address->getData('base_subtotal') + $address->getData('base_discount_amount');
         $subtotalWithDiscount = $address->getData('subtotal') + $address->getData('discount_amount');
         $pointsSpendingCalculation = Mage::helper('points/config')->getPointsSpendingCalculation();
         if ($pointsSpendingCalculation !== AW_Points_Helper_Config::BEFORE_TAX) {
             $baseSubtotalWithDiscount += $address->getData('base_tax_amount');
             $subtotalWithDiscount += $address->getData('tax_amount');
         }
         $limitedPoints = Mage::helper('points')->getLimitedPoints($baseSubtotalWithDiscount, $customer, $storeId);
         $pointsAmountUsed = min($pointsAmountUsed, $pointsAmountAllowed, $limitedPoints);
         $session->setData('points_amount', $pointsAmountUsed);
         $rate = Mage::getModel('points/rate')->setCurrentCustomer($customer)->setCurrentWebsite($website)->loadByDirection(AW_Points_Model_Rate::POINTS_TO_CURRENCY);
         if (!$rate->getId()) {
             return $this;
         }
         $moneyBaseCurrencyForPoints = $rate->exchange($pointsAmountUsed);
         $moneyCurrentCurrencyForPoints = Mage::app()->getStore()->convertPrice($moneyBaseCurrencyForPoints);
         /**
          * If points amount is more then needed to pay for subtotal with discount for order,
          * we need to set new points amount
          */
         if ($moneyBaseCurrencyForPoints > $baseSubtotalWithDiscount) {
             $neededAmount = ceil($baseSubtotalWithDiscount * $rate->getPoints() / $rate->getMoney());
             $neededAmountBaseCurrency = $rate->exchange($neededAmount);
             $neededAmountCurrentCurrency = Mage::app()->getStore()->convertPrice($neededAmountBaseCurrency);
             $session->setData('points_amount', $neededAmount);
             $address->setGrandTotal($address->getData('grand_total') - $subtotalWithDiscount);
             $address->setBaseGrandTotal($address->getData('base_grand_total') - $baseSubtotalWithDiscount);
             $address->setMoneyForPoints($neededAmountCurrentCurrency);
             $address->setBaseMoneyForPoints($neededAmountBaseCurrency);
             $quote->setMoneyForPoints($neededAmountCurrentCurrency);
             $quote->setBaseMoneyForPoints($neededAmountBaseCurrency);
         } else {
             $address->setGrandTotal($address->getGrandTotal() - $moneyCurrentCurrencyForPoints);
             $address->setBaseGrandTotal($address->getBaseGrandTotal() - $moneyBaseCurrencyForPoints);
             $address->setMoneyForPoints($moneyCurrentCurrencyForPoints);
             $address->setBaseMoneyForPoints($moneyBaseCurrencyForPoints);
             $quote->setMoneyForPoints($moneyCurrentCurrencyForPoints);
             $quote->setBaseMoneyForPoints($moneyBaseCurrencyForPoints);
         }
     }
     return $this;
 }
开发者ID:HPTTeam,项目名称:hackathon,代码行数:56,代码来源:Points.php

示例4: fetch

 public function fetch(Mage_Sales_Model_Quote_Address $address)
 {
     if ($address->getData('address_type') == 'billing') {
         return $this;
     }
     $amount = (double) $address->getStoreCreditDiscount();
     if ($amount > 0) {
         $address->addTotal(array('code' => $this->getCode(), 'title' => 'Store Credit Discount (' . $amount . ' credit used)', 'value' => '-' . $amount));
     }
     return $address;
 }
开发者ID:R-MAN-D,项目名称:magento-custom-discount-store-credit-module,代码行数:11,代码来源:Deduction.php

示例5: fetch

 public function fetch(Mage_Sales_Model_Quote_Address $address)
 {
     if ($address->getData('address_type') == 'billing') {
         return $this;
     }
     $discount = $address->getGiftcardDiscount();
     $gcCode = Mage::getSingleton('core/session')->getGiftcardCode();
     if ($discount > 0) {
         $address->addTotal(array('code' => $this->getCode(), 'title' => Mage::helper('sales')->__('Gift Card (' . $gcCode . ')'), 'value' => -$discount));
     }
 }
开发者ID:pmathbliss,项目名称:shopping-cart-integrations,代码行数:11,代码来源:Giftcard.php

示例6: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $quote = $address->getQuote();
     $session = Mage::getSingleton('checkout/session');
     $customer = Mage::getSingleton('customer/session')->getCustomer();
     $params = Mage::app()->getRequest()->getParam('payment');
     if ($params['use_point'] != null || $params['point_amount'] != null) {
         $session->setData('use_point', $params['use_point'])->setData('point_amount', $params['point_amount']);
     }
     if ($session->getData('use_point') && $address->getBaseGrandTotal() && $customer->getId()) {
         $pointAmount = $session->getData('point_amount');
         $rate = Mage::getModel('customerreward/rate')->getPointToMoneyRate($customer->getWebsiteId(), $customer->getGroupId());
         $moneyBase = $pointAmount * $rate;
         $currentMoney = Mage::app()->getStore()->convertPrice($moneyBase);
         $baseSubtotalWithDiscount = $address->getData('base_subtotal') + $address->getData('base_discount_amount');
         $subtotalWithDiscount = $address->getData('subtotal') + $address->getData('discount_amount');
         if ($moneyBase < $baseSubtotalWithDiscount) {
             $address->setBaseGrandTotal($address->getBaseGrandTotal() - $moneyBase);
             $address->setGrandTotal($address->getGrandTotal() - $currentMoney);
             $address->setMoneyBase($moneyBase);
             $address->setCurrentMoney($currentMoney);
             $quote->setMoneyBase($moneyBase);
             $quote->setCurrentMoney($currentMoney);
         } else {
             $pointUsed = ceil($baseSubtotalWithDiscount / $rate);
             $moneyBaseUsed = $pointUsed * $rate;
             $currentMoneyUsed = Mage::app()->getStore()->convertPrice($moneyBaseUsed);
             $session->setData('point_amount', $pointUsed);
             $address->setBaseGrandTotal($address->getBaseGrandTotal() - $baseSubtotalWithDiscount);
             $address->setGrandTotal($address->getGrandTotal() - $subtotalWithDiscount);
             $address->setMoneyBase($moneyBaseUsed);
             $address->setCurrentMoney($currentMoneyUsed);
             $quote->setMoneyBase($moneyBaseUsed);
             $quote->setCurrentMoney($currentMoneyUsed);
         }
     }
     return $this;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:38,代码来源:Point.php

示例7: _processValidateCustomer

 /**
  * Validate customer data and set some its data for further usage in quote
  * Will return either true or array with error messages
  *
  * @param Mage_Sales_Model_Quote_Address $address
  * @return true|array
  */
 protected function _processValidateCustomer(Mage_Sales_Model_Quote_Address $address)
 {
     // set customer date of birth for further usage
     $dob = '';
     if ($address->getDob()) {
         $dob = Mage::app()->getLocale()->date($address->getDob(), null, null, false)->toString('yyyy-MM-dd');
         $this->getQuote()->setCustomerDob($dob);
     }
     // set customer tax/vat number for further usage
     if ($address->getTaxvat()) {
         $this->getQuote()->setCustomerTaxvat($address->getTaxvat());
     }
     /* ADD RG E TIPO  */
     if ($address->getTipo()) {
         $this->getQuote()->setCustomerTipo($address->getTipo());
     }
     if ($address->getRg()) {
         $this->getQuote()->setCustomerRg($address->getRg());
     }
     /* ADD RG E TIPO  */
     // set customer gender for further usage
     if ($address->getGender()) {
         $this->getQuote()->setCustomerGender($address->getGender());
     }
     // invoke customer model, if it is registering
     if (self::METHOD_REGISTER == $this->getQuote()->getCheckoutMethod()) {
         // set customer password hash for further usage
         $customer = Mage::getModel('customer/customer');
         $this->getQuote()->setPasswordHash($customer->encryptPassword($address->getCustomerPassword()));
         // validate customer
         foreach (array('firstname' => 'firstname', 'lastname' => 'lastname', 'email' => 'email', 'password' => 'customer_password', 'confirmation' => 'confirm_password', 'taxvat' => 'taxvat', 'gender' => 'gender', 'rg' => 'rg', 'tipo' => 'tipo') as $key => $dataKey) {
             $customer->setData($key, $address->getData($dataKey));
         }
         if ($dob) {
             $customer->setDob($dob);
         }
         $validationResult = $customer->validate();
         if (true !== $validationResult && is_array($validationResult)) {
             return array('error' => -1, 'message' => implode(', ', $validationResult));
         }
     } elseif (self::METHOD_GUEST == $this->getQuote()->getCheckoutMethod()) {
         $email = $address->getData('email');
         if (!Zend_Validate::is($email, 'EmailAddress')) {
             return array('error' => -1, 'message' => $this->_helper->__('Invalid email address "%s"', $email));
         }
     }
     return true;
 }
开发者ID:jpedro21,项目名称:comerciodoboi,代码行数:55,代码来源:Onestep.php

示例8: resetAddress

 protected function resetAddress(Mage_Sales_Model_Quote_Address $address)
 {
     $address->setDiscountAmount(0.0);
     $address->setBaseDiscountAmount(0.0);
     $address->setSubtotalWithDiscount($address->getSubtotal());
     $address->setBaseSubtotalWithDiscount($address->getBaseSubtotal());
     $address->setDiscountDescription('');
     $address->setDiscountDescriptionArray([]);
     if (!$address->getData('__applied_rules_reset__')) {
         $address->setAppliedRuleIds('');
         $address->setData('__applied_rules_reset__', true);
     }
     $address->setShippingDiscountAmount(0);
     $address->setBaseShippingDiscountAmount(0);
     $address->setFreeShipping(false);
 }
开发者ID:aoepeople,项目名称:aoe_salesrule,代码行数:16,代码来源:Discount.php

示例9: collect

 /**
  * Used each time when collectTotals is invoked
  *
  * @param Mage_Sales_Model_Quote_Address $address
  * @return Your_Module_Model_Total_Custom
  */
 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     if ($address->getData('address_type') == 'billing') {
         return $this;
     }
     $this->_setAddress($address);
     if ($ammount = $address->getQuote()->getInterest()) {
         $this->_setBaseAmount($ammount);
         $this->_setAmount($address->getQuote()->getStore()->convertPrice($ammount, false));
         $address->setInterest($ammount);
     } else {
         $this->_setBaseAmount(0.0);
         $this->_setAmount(0.0);
     }
     return $this;
 }
开发者ID:AZPay,项目名称:Magento-Azpay,代码行数:22,代码来源:Interest.php

示例10: fetch

 public function fetch(Mage_Sales_Model_Quote_Address $address)
 {
     $quote = $address->getQuote();
     if (!Mage::getStoreConfig('tax/calculation/apply_after_discount', $quote->getStoreId())) {
         return $this;
     }
     if (!$quote->isVirtual() && $address->getData('address_type') == 'billing') {
         return $this;
     }
     $session = Mage::getSingleton('checkout/session');
     $customer_credit_discount = $address->getCustomercreditDiscount();
     if ($session->getBaseCustomerCreditAmount()) {
         $customer_credit_discount = $session->getBaseCustomerCreditAmount();
     }
     //  zend_debug::Dump($session->getBaseCustomerCreditAmount());die();
     if (!$session->getHasCustomerCreditItem()) {
         if ($customer_credit_discount > 0) {
             $address->addTotal(array('code' => $this->getCode(), 'title' => Mage::helper('customercredit')->__('Customer Credit'), 'value' => -$customer_credit_discount));
         }
     }
     return $this;
 }
开发者ID:protechhelp,项目名称:gamamba,代码行数:22,代码来源:Discount.php

示例11: setShippingAddress

 /**
  * Enter description here...
  *
  * @param Mage_Sales_Model_Quote_Address $address
  * @return Mage_Sales_Model_Quote
  */
 public function setShippingAddress(Mage_Sales_Model_Quote_Address $address)
 {
     if ($this->getIsMultiShipping()) {
         $this->addAddress($address->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_SHIPPING));
     } else {
         $old = $this->getShippingAddress();
         if (!empty($old)) {
             $old->addData($address->getData());
         } else {
             $this->addAddress($address->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_SHIPPING));
         }
     }
     return $this;
 }
开发者ID:axovel,项目名称:easycarcare,代码行数:20,代码来源:Quote.php

示例12: _processValidateCustomer

 protected function _processValidateCustomer(Mage_Sales_Model_Quote_Address $address)
 {
     if ($address->getTaxvat()) {
         $this->getQuote()->setCustomerTaxvat($address->getTaxvat());
     }
     if ($this->getQuote()->getCheckoutMethod() == self::REGISTER) {
         $customer = Mage::getModel('customer/customer');
         $this->getQuote()->setPasswordHash($customer->encryptPassword($address->getCustomerPassword()));
         $cust_data = array('email' => 'email', 'password' => 'customer_password', 'confirmation' => 'confirm_password', 'firstname' => 'firstname', 'lastname' => 'lastname', 'taxvat' => 'taxvat');
         foreach ($cust_data as $key => $value) {
             $customer->setData($key, $address->getData($value));
         }
         $val_result = $customer->validate();
         if ($val_result !== true && is_array($val_result)) {
             return array('message' => implode(', ', $val_result), 'error' => -1);
         }
     } elseif ($this->getQuote()->getCheckoutMethod() == self::GUEST) {
         $email = $address->getData('email');
         if (!Zend_Validate::is($email, 'EmailAddress')) {
             return array('message' => $this->_help_obj->__('Invalid email address "%s"', $email), 'error' => -1);
         }
     }
     return true;
 }
开发者ID:Evandro-correia,项目名称:one_step_checkout_simplificado,代码行数:24,代码来源:Geo.php

示例13: fetch

 public function fetch(Mage_Sales_Model_Quote_Address $address)
 {
     $quote = $address->getQuote();
     if (Mage::getStoreConfig('customercredit/spend/tax', $quote->getStoreId()) == 1) {
         return $this;
     }
     if (!$quote->isVirtual() && $address->getData('address_type') == 'billing') {
         return $this;
     }
     $session = Mage::getSingleton('checkout/session');
     $customer_credit_discount = $address->getCustomercreditDiscount();
     if ($session->getBaseCustomerCreditAmount()) {
         $customer_credit_discount = $session->getBaseCustomerCreditAmount();
     }
     if ($customer_credit_discount > 0) {
         $address->addTotal(array('code' => $this->getCode(), 'title' => Mage::helper('customercredit')->__('Customer Credit'), 'value' => -$customer_credit_discount));
     }
     return $this;
 }
开发者ID:javik223,项目名称:Evron-Magento,代码行数:19,代码来源:Discountbeforetax.php

示例14: _copyAddress

 /**
  * Copy real address to the quote
  *
  * @param Mage_Sales_Model_Quote $quote
  * @param Mage_Sales_Model_Quote_Address $realAddress
  * @return Mage_Sales_Model_Quote_Address
  */
 protected function _copyAddress($quote, $realAddress)
 {
     $address = Mage::getModel('sales/quote_address');
     $address->setData($realAddress->getData());
     $address->setId(null)->unsEntityId()->unsetData('cached_items_nominal')->unsetData('cached_items_nonnominal')->unsetData('cached_items_all')->setQuote($quote);
     return $address;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:14,代码来源:Observer.php

示例15: _anonymizeQuoteAddress

 /**
  * @param Mage_Sales_Model_Quote_Address $quoteAddress
  * @param array $randomData
  */
 protected function _anonymizeQuoteAddress($quoteAddress, $randomData)
 {
     foreach ($this->_getAddressMapping() as $addressKey => $randomDataKey) {
         if (!$quoteAddress->getData($addressKey)) {
             continue;
         }
         if (strlen($randomDataKey)) {
             $quoteAddress->setData($addressKey, $randomData[$randomDataKey]);
         } else {
             $quoteAddress->setData($addressKey, '');
         }
     }
     $quoteAddress->getResource()->save($quoteAddress);
     $this->_anonymizedQuoteAddressIds[] = $quoteAddress->getId();
 }
开发者ID:buro71a,项目名称:Anonymizer,代码行数:19,代码来源:Anonymizer.php


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