本文整理汇总了PHP中Mage_Sales_Model_Quote::getStoreId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote::getStoreId方法的具体用法?PHP Mage_Sales_Model_Quote::getStoreId怎么用?PHP Mage_Sales_Model_Quote::getStoreId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote::getStoreId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeQuoteItems
private function initializeQuoteItems()
{
foreach ($this->proxyOrder->getItems() as $item) {
$this->clearQuoteItemsCache();
/** @var $quoteItemBuilder Ess_M2ePro_Model_Magento_Quote_Item */
$quoteItemBuilder = Mage::getModel('M2ePro/Magento_Quote_Item');
$quoteItemBuilder->init($this->quote, $item);
$product = $quoteItemBuilder->getProduct();
$request = $quoteItemBuilder->getRequest();
// ----------------------------
$productOriginalPrice = (double) $product->getPrice();
$price = $item->getBasePrice();
$product->setPrice($price);
$product->setSpecialPrice($price);
// ----------------------------
// see Mage_Sales_Model_Observer::substractQtyFromQuotes
$this->quote->setItemsCount($this->quote->getItemsCount() + 1);
$this->quote->setItemsQty((double) $this->quote->getItemsQty() + $request->getQty());
$result = $this->quote->addProduct($product, $request);
if (is_string($result)) {
throw new Exception($result);
}
$quoteItem = $this->quote->getItemByProduct($product);
if ($quoteItem !== false) {
$weight = $product->getTypeInstance()->getWeight();
if ($product->isConfigurable()) {
// hack: for child product weight was not load
$simpleProductId = $product->getCustomOption('simple_product')->getProductId();
$weight = Mage::getResourceModel('catalog/product')->getAttributeRawValue($simpleProductId, 'weight', 0);
}
$quoteItem->setStoreId($this->quote->getStoreId());
$quoteItem->setOriginalCustomPrice($item->getPrice());
$quoteItem->setOriginalPrice($productOriginalPrice);
$quoteItem->setBaseOriginalPrice($productOriginalPrice);
$quoteItem->setWeight($weight);
$quoteItem->setNoDiscount(1);
$giftMessageId = $quoteItemBuilder->getGiftMessageId();
if (!empty($giftMessageId)) {
$quoteItem->setGiftMessageId($giftMessageId);
}
$quoteItem->setAdditionalData($quoteItemBuilder->getAdditionalData($quoteItem));
}
}
}
示例2: collect
/**
* collect reward points that customer earned (per each item and address) total
*
* @param Mage_Sales_Model_Quote_Address $address
* @param Mage_Sales_Model_Quote $quote
* @return Magestore_RewardPoints_Model_Total_Quote_Point
*/
public function collect($address, $quote)
{
if (!Mage::helper('rewardpoints')->isEnable($quote->getStoreId())) {
return $this;
}
// get points that customer can earned by Rates
if ($quote->isVirtual()) {
$address = $quote->getBillingAddress();
} else {
$address = $quote->getShippingAddress();
}
$baseGrandTotal = $quote->getBaseGrandTotal();
if (!Mage::getStoreConfigFlag(Magestore_RewardPoints_Helper_Calculation_Earning::XML_PATH_EARNING_BY_SHIPPING, $quote->getStoreId())) {
$baseGrandTotal -= $address->getBaseShippingAmount();
}
if (!Mage::getStoreConfigFlag(Magestore_RewardPoints_Helper_Calculation_Earning::XML_PATH_EARNING_BY_TAX, $quote->getStoreId())) {
$baseGrandTotal -= $address->getBaseTaxAmount();
}
$baseGrandTotal = max(0, $baseGrandTotal);
$earningPoints = Mage::helper('rewardpoints/calculation_earning')->getRateEarningPoints($baseGrandTotal, $quote->getStoreId());
if ($earningPoints > 0) {
$address->setRewardpointsEarn($earningPoints);
}
Mage::dispatchEvent('rewardpoints_collect_earning_total_points_before', array('address' => $address));
// Update earning point for each items
$this->_updateEarningPoints($address);
Mage::dispatchEvent('rewardpoints_collect_earning_total_points_after', array('address' => $address));
return $this;
}
示例3: getAssociatedGroupedProduct
private function getAssociatedGroupedProduct()
{
$associatedProducts = $this->proxyItem->getAssociatedProducts();
$associatedProductId = reset($associatedProducts);
$product = Mage::getModel('catalog/product')->setStoreId($this->quote->getStoreId())->load($associatedProductId);
return $product->getId() ? $product : null;
}
示例4: 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;
}
示例5: 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!'));
}
}
示例6: getCheckoutShortcutImageUrl
/**
* Checkout with PayPal image URL getter
* @return string
*/
public function getCheckoutShortcutImageUrl()
{
$localUrl = $this->getHelperConfig()->getConfigGeneral($this->_quote->getStoreId())->getPaymentPaypalExpressCheckout()->getPaypalExpressCheckoutImage();
if ($localUrl) {
return Mage::getBaseUrl('media') . 'payone' . DS . $localUrl;
}
return sprintf('https://www.paypal.com/%s/i/btn/btn_xpressCheckout.gif', $this->_getSupportedLocaleCode(Mage::app()->getLocale()->getLocaleCode()));
}
示例7: 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();
}
}
示例8: 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;
}
示例9: 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;
}
示例10: isAvailable
/**
* @param Mage_Sales_Model_Quote|null $quote
* @return bool
*/
public function isAvailable($quote = null)
{
$isAvailable = parent::isAvailable();
$disableZeroTotal = Mage::getStoreConfig('payment/adyen_hpp/disable_zero_total', $quote->getStoreId());
if (!is_null($quote) && $quote->getGrandTotal() <= 0 && $disableZeroTotal) {
return false;
}
return $isAvailable;
}
示例11: isCCAndZeroAmountAuthAllowed
/**
* check if payment method is cc and zero amount authorization is enabled
*
* @param Netresearch_OPS_Model_Payment_Abstract $opsPaymentMethod
*
* @return bool
*/
public function isCCAndZeroAmountAuthAllowed(Netresearch_OPS_Model_Payment_Abstract $opsPaymentMethod, Mage_Sales_Model_Quote $quote)
{
$result = false;
$storeId = $quote->getStoreId();
if ($quote->getBaseGrandTotal() < 0.01 && $opsPaymentMethod instanceof Netresearch_OPS_Model_Payment_Cc && $opsPaymentMethod->isZeroAmountAuthorizationAllowed($storeId) && 0 < $quote->getItemsCount()) {
$result = true;
}
return $result;
}
示例12: toOrder
/**
* Convert quote model to order model
*
* @param Mage_Sales_Model_Quote $quote
* @return Mage_Sales_Model_Order
*/
public function toOrder(Mage_Sales_Model_Quote $quote, $order = null)
{
if (!$order instanceof Mage_Sales_Model_Order) {
$order = Mage::getModel('sales/order');
}
/* @var $order Mage_Sales_Model_Order */
$order->setStoreId($quote->getStoreId())->setQuoteId($quote->getId())->setRemoteIp($quote->getRemoteIp())->setCustomerId($quote->getCustomerId())->setCustomerEmail($quote->getCustomerEmail())->setCustomerFirstname($quote->getCustomerFirstname())->setCustomerLastname($quote->getCustomerLastname())->setCustomerGroupId($quote->getCustomerGroupId())->setCustomerTaxClassId($quote->getCustomerTaxClassId())->setCustomerNote($quote->getCustomerNote())->setCustomerNoteNotify($quote->getCustomerNoteNotify())->setCustomerIsGuest($quote->getCustomerIsGuest())->setBaseCurrencyCode($quote->getBaseCurrencyCode())->setStoreCurrencyCode($quote->getStoreCurrencyCode())->setOrderCurrencyCode($quote->getQuoteCurrencyCode())->setStoreToBaseRate($quote->getStoreToBaseRate())->setStoreToOrderRate($quote->getStoreToQuoteRate())->setCouponCode($quote->getCouponCode())->setGiftcertCode($quote->getGiftcertCode())->setIsVirtual($quote->getIsVirtual())->setIsMultiPayment($quote->getIsMultiPayment())->setAppliedRuleIds($quote->getAppliedRuleIds());
Mage::dispatchEvent('sales_convert_quote_to_order', array('order' => $order, 'quote' => $quote));
return $order;
}
示例13: toOrder
/**
* Convert quote model to order model
*
* @param Mage_Sales_Model_Quote $quote
* @return Mage_Sales_Model_Order
*/
public function toOrder(Mage_Sales_Model_Quote $quote, $order = null)
{
if (!$order instanceof Mage_Sales_Model_Order) {
$order = Mage::getModel('sales/order');
}
/* @var $order Mage_Sales_Model_Order */
$order->setIncrementId($quote->getReservedOrderId())->setStoreId($quote->getStoreId())->setQuoteId($quote->getId())->setCustomer($quote->getCustomer());
Mage::helper('core')->copyFieldset('sales_convert_quote', 'to_order', $quote, $order);
Mage::dispatchEvent('sales_convert_quote_to_order', array('order' => $order, 'quote' => $quote));
return $order;
}
示例14: isAvailable
/**
* Check whether payment method can be used
*
* @param Mage_Sales_Model_Quote $quote
* @return bool
*/
public function isAvailable($quote = null)
{
$storeId = false;
$model = Mage::registry('current_app');
if ($model instanceof Mage_XmlConnect_Model_Application) {
$storeId = $model->getStoreId();
}
if (!$storeId) {
$storeId = $quote ? $quote->getStoreId() : Mage::app()->getStore()->getId();
}
return (bool) Mage::getModel('paypal/config')->setStoreId($storeId)->isMethodAvailable(Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS);
}
示例15: toOrder
/**
* Convert quote model to order model
*
* @param Mage_Sales_Model_Quote $quote
* @return Mage_Sales_Model_Order
*/
public function toOrder(Mage_Sales_Model_Quote $quote, $order = null)
{
if (!$order instanceof Mage_Sales_Model_Order) {
$order = Mage::getModel('sales/order');
}
/* @var $order Mage_Sales_Model_Order */
$order->setIncrementId($quote->getReservedOrderId())->setStoreId($quote->getStoreId())->setQuoteId($quote->getId());
Mage::helper('core')->copyFieldset('sales_convert_quote', 'to_order', $quote, $order);
if (!$quote->getCustomerId()) {
$order->setCustomerId(null);
}
//
// ->setRemoteIp($quote->getRemoteIp())
//
// /**
// * Customer data
// */
// ->setCustomerId($quote->getCustomerId())
// ->setCustomerEmail($quote->getCustomerEmail())
// ->setCustomerPrefix($quote->getCustomerPrefix())
// ->setCustomerFirstname($quote->getCustomerFirstname())
// ->setCustomerMiddlename($quote->getCustomerMiddlename())
// ->setCustomerLastname($quote->getCustomerLastname())
// ->setCustomerSuffix($quote->getCustomerSuffix())
// ->setCustomerGroupId($quote->getCustomerGroupId())
// ->setCustomerTaxClassId($quote->getCustomerTaxClassId())
// ->setCustomerNote($quote->getCustomerNote())
// ->setCustomerNoteNotify($quote->getCustomerNoteNotify())
// ->setCustomerIsGuest($quote->getCustomerIsGuest())
// ->setCustomerDob($quote->getCustomerDob())
//
// /**
// * Currency data
// */
// ->setBaseCurrencyCode($quote->getBaseCurrencyCode())
// ->setStoreCurrencyCode($quote->getStoreCurrencyCode())
// ->setOrderCurrencyCode($quote->getQuoteCurrencyCode())
// ->setStoreToBaseRate($quote->getStoreToBaseRate())
// ->setStoreToOrderRate($quote->getStoreToQuoteRate())
//
// /**
// * Another data
// */
// ->setCouponCode($quote->getCouponCode())
// ->setGiftcertCode($quote->getGiftcertCode())
// ->setIsVirtual($quote->getIsVirtual())
// ->setIsMultiPayment($quote->getIsMultiPayment())
// ->setAppliedRuleIds($quote->getAppliedRuleIds());
Mage::dispatchEvent('sales_convert_quote_to_order', array('order' => $order, 'quote' => $quote));
return $order;
}