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


PHP Mage_Sales_Model_Quote类代码示例

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


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

示例1: convertBirthdate

 /**
  * add birthdate to params list, if it is available
  *
  * @param Mage_Sales_Model_Quote $quote Quote
  * @return array Either empty or with birthdate
  */
 public function convertBirthdate($quote)
 {
     if (is_null($quote->getCustomerDob())) {
         return array();
     }
     return array('GEBURTSDATUM' => Mage::getModel('core/date')->date('d.m.Y', $quote->getCustomerDob()));
 }
开发者ID:kirchbergerknorr,项目名称:netresearch_buergel,代码行数:13,代码来源:Request.php

示例2: resetQuote

 protected function resetQuote(Mage_Sales_Model_Quote $quote)
 {
     if (!$quote->getData('__applied_rules_reset__')) {
         $quote->setAppliedRuleIds('');
         $quote->setData('__applied_rules_reset__', true);
     }
 }
开发者ID:aoepeople,项目名称:aoe_salesrule,代码行数:7,代码来源:Discount.php

示例3: isAvailable

 /**
  * Check whether method is available
  *
  * @param Mage_Sales_Model_Quote|null $quote
  * @return bool
  */
 public function isAvailable($quote = null)
 {
     /* custom code written to round price here as roundPrice function was changed */
     $_grand_price = Mage::app()->getStore()->roundPrice($quote->getGrandTotal());
     $_grand_price = round($_grand_price, 2);
     return parent::isAvailable($quote) && !empty($quote) && $_grand_price == 0;
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:13,代码来源:Free.php

示例4: setUp

 protected function setUp()
 {
     parent::setUp();
     $quote = new Mage_Sales_Model_Quote();
     $quote->load('test01', 'reserved_order_id');
     Mage::getSingleton('Mage_Checkout_Model_Session')->setQuoteId($quote->getId());
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:7,代码来源:OnepageController.php

示例5: _addErrorMessage

 /**
  * Add error message if estimation has error
  *
  * @param Mage_Sales_Model_Quote $quote
  * @return $this
  */
 protected function _addErrorMessage($quote)
 {
     if ($quote->getData('estimate_tax_error')) {
         $this->_getErrorsHelper()->addErrorMessage($quote);
     }
     return $this;
 }
开发者ID:onepica,项目名称:avatax,代码行数:13,代码来源:Abstract.php

示例6: prepareCollection

 /**
  * Convert the resource model collection to an array
  *
  * @param Mage_Sales_Model_Quote $quote
  *
  * @return array
  */
 public function prepareCollection(Mage_Sales_Model_Quote $quote)
 {
     // Store current state
     $actionType = $this->getActionType();
     $operation = $this->getOperation();
     // Change state
     $this->setActionType(self::ACTION_TYPE_COLLECTION);
     $this->setOperation(self::OPERATION_RETRIEVE);
     $data = [];
     // Get store
     $store = $quote->getStoreId();
     // Get filter
     $filter = $this->getFilter();
     // Prepare methods
     foreach (Mage::helper('payment')->getStoreMethods($store, $quote) as $method) {
         /** @var $method Mage_Payment_Model_Method_Abstract */
         if ($this->_canUseMethod($method, $quote) && $method->isApplicableToQuote($quote, Mage_Payment_Model_Method_Abstract::CHECK_ZERO_TOTAL)) {
             $method->setInfoInstance($quote->getPayment());
             $data[] = $this->prepareMethod($method, $filter);
         }
     }
     // Restore old state
     $this->setActionType($actionType);
     $this->setOperation($operation);
     // Return prepared outbound data
     return $data;
 }
开发者ID:aoepeople,项目名称:aoe_cartapi,代码行数:34,代码来源:PaymentMethods.php

示例7: checkQuoteAmount

 public function checkQuoteAmount(Mage_Sales_Model_Quote $quote, $amount)
 {
     if (!$quote->getHasError() && $amount >= self::MAXIMUM_AVAILABLE_NUMBER) {
         $quote->setHasError(true);
         $quote->addMessage($this->__('Some items have quantities exceeding allowed quantities. Please select a lower quantity to checkout.'));
     }
     return $this;
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:8,代码来源:Data.php

示例8: getOwnerParams

 /**
  * extraxcts the according Barclaycard owner* parameter
  *
  * @param Mage_Sales_Model_Quote               $quote
  * @param Mage_Customer_Model_Address_Abstract $billingAddress
  *
  * @return array
  */
 public function getOwnerParams(Mage_Sales_Model_Quote $quote, Mage_Customer_Model_Address_Abstract $billingAddress)
 {
     $ownerParams = array();
     if ($this->getConfig()->canSubmitExtraParameter($quote->getStoreId())) {
         $ownerParams = array('OWNERADDRESS' => str_replace("\n", ' ', $billingAddress->getStreet(1)), 'OWNERTOWN' => $billingAddress->getCity(), 'OWNERZIP' => $billingAddress->getPostcode(), 'OWNERTELNO' => $billingAddress->getTelephone(), 'OWNERCTY' => $billingAddress->getCountry(), 'ECOM_BILLTO_POSTAL_POSTALCODE' => $billingAddress->getPostcode());
     }
     return $ownerParams;
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:16,代码来源:Request.php

示例9: validateAlias

 /**
  * Validates alias for in quote provided addresses
  * @param Mage_Sales_Model_Quote $quote
  * @param Varien_Object $payment
  * @throws Mage_Core_Exception
  */
 protected function validateAlias($quote, $payment)
 {
     $alias = $payment->getAdditionalInformation('alias');
     if (0 < strlen(trim($alias)) && is_numeric($payment->getAdditionalInformation('cvc')) && false === Mage::helper('ops/alias')->isAliasValidForAddresses($quote->getCustomerId(), $alias, $quote->getBillingAddress(), $quote->getShippingAddress(), $quote->getStoreId())) {
         $this->getOnepage()->getCheckout()->setGotoSection('payment');
         Mage::throwException($this->getHelper()->__('Invalid payment information provided!'));
     }
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:14,代码来源:Cc.php

示例10: getAllConfigsByQuote

 /**
  * @api
  *
  * To be used in Form_Block, which has to display all wallet types
  *
  * @param Mage_Sales_Model_Quote $quote
  * @return Payone_Core_Model_Config_Payment_Method_Interface
  */
 public function getAllConfigsByQuote(Mage_Sales_Model_Quote $quote)
 {
     if (empty($this->matchingConfigs)) {
         $configStore = $this->getConfigStore($quote->getStoreId());
         $this->matchingConfigs = $configStore->getPayment()->getMethodsForQuote($this->methodType, $quote);
     }
     return $this->matchingConfigs;
 }
开发者ID:kirchbergerknorr,项目名称:payone-magento,代码行数:16,代码来源:Wallet.php

示例11: getQuoteCurrency

 /**
  * returns the quote currency
  *
  * @param $quote
  *
  * @return string - the quotes currency
  */
 public function getQuoteCurrency(Mage_Sales_Model_Quote $quote)
 {
     if ($quote->hasForcedCurrency()) {
         return $quote->getForcedCurrency()->getCode();
     } else {
         return Mage::app()->getStore($quote->getStoreId())->getBaseCurrencyCode();
     }
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:15,代码来源:Quote.php

示例12: minimunOrderQty

 /**
  * Check if quote meets the minimun quantity
  * of total items for a specific customer
  *
  * @todo   Change to more meaningful name
  *
  * @param  Mage_Sales_Model_Quote       $quote
  * @param  Mage_Customer_Model_Customer $customer
  * @return int|false
  */
 public function minimunOrderQty(Mage_Sales_Model_Quote $quote, Mage_Customer_Model_Customer $customer)
 {
     $minQtyForCustomer = $this->getConfigValue($customer->getGroupId());
     if ($quote->getItemsQty() < $minQtyForCustomer && $quote->getItemsQty() !== 0) {
         return $minQtyForCustomer;
     }
     return false;
 }
开发者ID:jahvi,项目名称:MinTotalQty,代码行数:18,代码来源:Data.php

示例13: updateQuote

 /**
  * Update Quote Email Address if is guest and current email address assigned doesn't match new email
  *
  * @param Mage_Sales_Model_Quote $quote
  */
 public function updateQuote(Mage_Sales_Model_Quote $quote)
 {
     $queue = Mage::getModel('bronto_emailcapture/queue');
     $currentEmail = $queue->getCurrentEmail();
     if (is_null($quote->getCustomerId()) && $queue->isValidEmail($currentEmail) && $quote->getCustomerEmail() !== $currentEmail) {
         $quote->setCustomerEmail(Mage::getModel('bronto_emailcapture/queue')->getCurrentEmail())->save();
     }
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:13,代码来源:Observer.php

示例14: populuateQuote

 /**
  * Makes Quote available for Magento Core classes
  *
  * @param Mage_Sales_Model_Quote $quote
  */
 public function populuateQuote(Mage_Sales_Model_Quote &$quote)
 {
     $quote->save();
     $quote = Mage::getModel('sales/quote')->load($quote->getId());
     Mage::getSingleton('checkout/cart')->setQuote($quote);
     Mage::getSingleton('checkout/session')->setQuoteId($quote->getId());
     Mage::getSingleton('checkout/type_onepage')->setQuote($quote);
 }
开发者ID:nhp,项目名称:Xtest,代码行数:13,代码来源:Frontend.php

示例15: checkQuoteAmount

 /**
  * Check quote amount
  *
  * @param Mage_Sales_Model_Quote $quote
  * @param decimal $amount
  * @return Mage_Sales_Helper_Data
  */
 public function checkQuoteAmount(Mage_Sales_Model_Quote $quote, $amount)
 {
     if (!$quote->getHasError() && $amount >= self::MAXIMUM_AVAILABLE_NUMBER) {
         $quote->setHasError(true);
         $quote->addMessage($this->__('Items maximum quantity or price do not allow checkout.'));
     }
     return $this;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:15,代码来源:Data.php


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