當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Mage_Sales_Model_Order::getStoreId方法代碼示例

本文整理匯總了PHP中Mage_Sales_Model_Order::getStoreId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Mage_Sales_Model_Order::getStoreId方法的具體用法?PHP Mage_Sales_Model_Order::getStoreId怎麽用?PHP Mage_Sales_Model_Order::getStoreId使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mage_Sales_Model_Order的用法示例。

在下文中一共展示了Mage_Sales_Model_Order::getStoreId方法的20個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的PHP代碼示例。

示例1: getStore

 /**
  * Returns requested store object.
  * 
  * @param int $storeId Specific store ID or null for current one.
  *
  * @return Mage_Core_Model_Store
  */
 public function getStore($storeId = null)
 {
     if (!$storeId && Mage::app()->getStore()->isAdmin()) {
         $storeId = $this->_order->getStoreId();
     }
     return Mage::app()->getStore($storeId);
 }
開發者ID:kirchbergerknorr,項目名稱:kirchbergerknorr_trustedbadge,代碼行數:14,代碼來源:Calltoaction.php


示例2: _sendEmail

 /**
  * @param Mage_Sales_Model_Order $order
  * @throws Mage_Core_Exception
  */
 protected function _sendEmail(Mage_Sales_Model_Order $order)
 {
     // Send email
     $translate = Mage::getSingleton('core/translate');
     $translate->setTranslateInline(false);
     /** @var Mage_Core_Helper_Data $helper */
     $helper = Mage::helper('core');
     $loginUrl = Mage::getUrl('ho_customer/account/login', array('encryption' => $helper->getEncryptor()->encrypt($order->getCustomerId()), 'forward_url' => base64_encode(Mage::getUrl('ho_customer/account/completeProfile'))));
     /** @var Mage_Core_Model_Email_Template $emailTemplate */
     $emailTemplate = Mage::getModel('core/email_template');
     $emailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $order->getStoreId()))->sendTransactional($this->getConfig()->getEmailTemplate($order->getStoreId()), $this->getConfig()->getEmailSender($order->getStoreId()), $order->getCustomerEmail(), $order->getCustomerName(), array('order' => $order, 'login_url' => $loginUrl));
     $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
     $customer->setData('complete_profile_sent', true)->getResource()->saveAttribute($customer, 'complete_profile_sent');
     $translate->setTranslateInline(true);
 }
開發者ID:hsq,項目名稱:Ho_Customer,代碼行數:19,代碼來源:FollowupEmail.php


示例3: createByApiResponse

 /**
  * @param Mage_Sales_Model_Order $order
  * @param Payone_Api_Response_Interface $response
  * @param Payone_Api_Request_Interface $request
  * @throws Payone_Core_Exception_TransactionAlreadyExists
  * @return null|Payone_Core_Model_Domain_Transaction
  */
 public function createByApiResponse(Mage_Sales_Model_Order $order, Payone_Api_Response_Interface $response, Payone_Api_Request_Interface $request)
 {
     $transaction = $this->getFactory()->getModelTransaction();
     $transaction->load($response->getTxid(), 'txid');
     // should not exist but to be sure load by txid
     if ($transaction->hasData()) {
         throw new Payone_Core_Exception_TransactionAlreadyExists($response->getTxid());
     }
     $transaction->setTxid($response->getTxid());
     $transaction->setLastTxaction($response->getStatus());
     $transaction->setUserid($response->getUserid());
     $transaction->setStoreId($order->getStoreId());
     $transaction->setOrderId($order->getId());
     $transaction->setReference($order->getIncrementId());
     $transaction->setCurrency($order->getOrderCurrencyCode());
     $transaction->setCustomerId($order->getCustomerId());
     $transaction->setClearingtype($request->getClearingtype());
     $transaction->setMode($request->getMode());
     $transaction->setMid($request->getMid());
     $transaction->setAid($request->getAid());
     $transaction->setPortalid($request->getPortalid());
     $transaction->setLastSequencenumber(0);
     $data = $response->toArray();
     $transaction->addData($data);
     $transaction->save();
     return $transaction;
 }
開發者ID:romfr,項目名稱:payone-magento,代碼行數:34,代碼來源:Create.php


示例4: seamlessConfirmAction

 /**
  * Confirm Controller for Seamless Payments
  */
 public function seamlessConfirmAction()
 {
     try {
         $data = $this->_checkReturnedPost(true);
         $storeId = $this->order->getStoreId();
         $methodCode = $this->paymentInst->getCode();
         $secretKey = Mage::getStoreConfig('payment/' . $methodCode . '/secret_key', $storeId);
         $confirmResponse = WirecardCEE_Client_QPay_Return::generateConfirmResponseString();
         $return = WirecardCEE_Client_QPay_Return::createReturnInstance($data['raw'], $secretKey);
         if ($return->validate()) {
             $this->_confirmState($data['post'], $return);
         } else {
             throw new Exception('Unhandled Wirecard Checkout Seamless action "' . $data['paymentState'] . '".');
         }
         $this->order->save();
         // send confirmation for status change
         die($confirmResponse);
     } catch (Exception $e) {
         $orderId = !empty($data['orderId']) ? $data['orderId'] : '';
         Mage::log('Wirecard Checkout Page transaction status update failed: ' . $e->getMessage() . '(' . $orderId . ')');
         Mage::log($e->getMessage() . "\n" . $e->getTraceAsString(), null, 'wirecard_checkout_page_exception.log');
         $confirmResponse = WirecardCEE_Client_QPay_Return::generateConfirmResponseString($e->getMessage());
         die($confirmResponse);
     }
 }
開發者ID:netzkollektiv,項目名稱:wirecard-checkout-magento,代碼行數:28,代碼來源:ProcessingController.php


示例5: addOrderToQueue

 /**
  * Add the items from the given order to the Order Sync queue. Does nothing if
  * Order Sync is disabled for the store that the order was placed in.
  *
  * @param Mage_Sales_Model_Order $order
  * @param bool                   $force Skip enabled check
  *
  * @return $this
  */
 public function addOrderToQueue(Mage_Sales_Model_Order $order, $force = false)
 {
     if (!$this->isEnabled($order->getStoreId()) && !$force) {
         return $this;
     }
     $items = array();
     foreach ($order->getAllVisibleItems() as $item) {
         /** @var Mage_Sales_Model_Order_Item $item */
         // For configurable products add children items only, for all other products add parents
         if ($item->getProductType() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {
             foreach ($item->getChildrenItems() as $child) {
                 if ($child->getId() != null) {
                     $items[] = $child->getId();
                 }
             }
         } else {
             if ($item->getId() != null) {
                 $items[] = $item->getId();
             }
         }
     }
     // in case of multiple addresses used for shipping
     // its possible that items object here is empty
     // if so, we do not add to the item.
     if (!empty($items)) {
         $this->addItemsToQueue($items);
     }
     return $this;
 }
開發者ID:mSupply,項目名稱:runnable_test_repo,代碼行數:38,代碼來源:Sync.php


示例6: logSale

 /**
  * Send order to MailChimp
  *
  * @param Mage_Sales_Model_Order $order
  * @return bool|array
  */
 public function logSale($order)
 {
     $this->_order = $order;
     $api = Mage::getSingleton('monkey/api', array('store' => $this->_order->getStoreId()));
     if (!$api) {
         return false;
     }
     $subtotal = $this->_order->getSubtotal();
     $discount = (double) $this->_order->getDiscountAmount();
     if ($discount != 0) {
         $subtotal = $subtotal + $discount;
     }
     $this->_info = array('id' => $this->_order->getIncrementId(), 'total' => $subtotal, 'shipping' => $this->_order->getShippingAmount(), 'tax' => $this->_order->getTaxAmount(), 'store_id' => $this->_order->getStoreId(), 'store_name' => $this->_order->getStoreName(), 'plugin_id' => 1215, 'items' => array());
     $emailCookie = $this->_getEmailCookie();
     $campaignCookie = $this->_getCampaignCookie();
     $this->setItemstoSend();
     if ($emailCookie && $campaignCookie) {
         $this->_info['email_id'] = $emailCookie;
         $this->_info['campaign_id'] = $campaignCookie;
         //Send order to MailChimp
         $rs = $api->campaignEcommOrderAdd($this->_info);
     } else {
         $this->_info['email'] = $this->_order->getCustomerEmail();
         $rs = $api->ecommOrderAdd($this->_info);
     }
     if ($rs === TRUE) {
         $this->_logCall();
         return true;
     } else {
         return $rs;
     }
 }
開發者ID:shashankkanungo,項目名稱:magento,代碼行數:38,代碼來源:Ecommerce360.php


示例7: _getTrackingUrl

 /**
  * Retrieve tracking url with params
  *
  * @param  string $key
  * @param  Mage_Sales_Model_Order|Mage_Sales_Model_Order_Shipment|Mage_Sales_Model_Order_Shipment_Track $model
  * @param  string $method Optional - method of a model to get id
  * @return string
  */
 protected function _getTrackingUrl($key, $model, $method = 'getId')
 {
     $helper = Mage::helper('Mage_Core_Helper_Data');
     $urlPart = "{$key}:{$model->{$method}()}:{$model->getProtectCode()}";
     $param = array('hash' => $helper->urlEncode($urlPart));
     $storeModel = Mage::app()->getStore($model->getStoreId());
     return $storeModel->getUrl('shipping/tracking/popup', $param);
 }
開發者ID:relue,項目名稱:magento2,代碼行數:16,代碼來源:Data.php


示例8: toQuote

 /**
  * Converting order object to quote object
  *
  * @param   Mage_Sales_Model_Order $order
  * @return  Mage_Sales_Model_Quote
  */
 public function toQuote(Mage_Sales_Model_Order $order, $quote = null)
 {
     if (!$quote instanceof Mage_Sales_Model_Quote) {
         $quote = Mage::getModel('sales/quote');
     }
     $quote->setStoreId($order->getStoreId())->setOrderId($order->getId())->setCustomerId($order->getCustomerId())->setCustomerEmail($order->getCustomerEmail())->setCustomerGroupId($order->getCustomerGroupId())->setCustomerTaxClassId($order->getCustomerTaxClassId())->setCustomerIsGuest($order->getCustomerIsGuest())->setBaseCurrencyCode($order->getBaseCurrencyCode())->setStoreCurrencyCode($order->getStoreCurrencyCode())->setQuoteCurrencyCode($order->getOrderCurrencyCode())->setStoreToBaseRate($order->getStoreToBaseRate())->setStoreToQuoteRate($order->getStoreToOrderRate())->setGrandTotal($order->getGrandTotal())->setBaseGrandTotal($order->getBaseGrandTotal())->setCouponCode($order->getCouponCode())->setGiftcertCode($order->getGiftcertCode())->setAppliedRuleIds($order->getAppliedRuleIds())->collectTotals();
     Mage::dispatchEvent('sales_convert_order_to_quote', array('order' => $order, 'quote' => $quote));
     return $quote;
 }
開發者ID:arslbbt,項目名稱:mangentovies,代碼行數:15,代碼來源:Order.php


示例9: setOrder

 /**
  * Set order object and grab some metadata from it
  *
  * @param   Mage_Sales_Model_Order $order
  * @return  Mage_Sales_Model_Order_Status_History
  */
 public function setOrder(Mage_Sales_Model_Order $order)
 {
     $this->_order = $order;
     $id = $order->getId();
     if (!$id) {
         $this->_shouldSetOrderBeforeSave = true;
     }
     return $this->setParentId($id)->setStoreId($order->getStoreId());
 }
開發者ID:hunnybohara,項目名稱:magento-chinese-localization,代碼行數:15,代碼來源:History.php


示例10: _validateEventData

 /**
  * Checking returned parameters
  * Thorws Mage_Core_Exception if error
  * @param bool $fullCheck Whether to make additional validations such as payment status, transaction signature etc.
  *
  * @return array  $params request params
  */
 protected function _validateEventData($fullCheck = true)
 {
     // get request variables
     $params = $this->_eventData;
     if (empty($params)) {
         Mage::throwException('Request does not contain any elements.');
     }
     // check order ID
     if (empty($params['transaction_id']) || $fullCheck == false && $this->_getCheckout()->getMoneybookersRealOrderId() != $params['transaction_id']) {
         Mage::throwException('Missing or invalid order ID.');
     }
     // load order for further validation
     $this->_order = Mage::getModel('sales/order')->loadByIncrementId($params['transaction_id']);
     if (!$this->_order->getId()) {
         Mage::throwException('Order not found.');
     }
     if (0 !== strpos($this->_order->getPayment()->getMethodInstance()->getCode(), 'moneybookers_')) {
         Mage::throwException('Unknown payment method.');
     }
     // make additional validation
     if ($fullCheck) {
         // check payment status
         if (empty($params['status'])) {
             Mage::throwException('Unknown payment status.');
         }
         // check transaction signature
         if (empty($params['md5sig'])) {
             Mage::throwException('Invalid transaction signature.');
         }
         $checkParams = array('merchant_id', 'transaction_id', 'secret', 'mb_amount', 'mb_currency', 'status');
         $md5String = '';
         foreach ($checkParams as $key) {
             if ($key == 'merchant_id') {
                 $md5String .= Mage::getStoreConfig(Phoenix_Moneybookers_Helper_Data::XML_PATH_CUSTOMER_ID, $this->_order->getStoreId());
             } elseif ($key == 'secret') {
                 $secretKey = Mage::getStoreConfig(Phoenix_Moneybookers_Helper_Data::XML_PATH_SECRET_KEY, $this->_order->getStoreId());
                 if (empty($secretKey)) {
                     Mage::throwException('Secret key is empty.');
                 }
                 $md5String .= strtoupper(md5($secretKey));
             } elseif (isset($params[$key])) {
                 $md5String .= $params[$key];
             }
         }
         $md5String = strtoupper(md5($md5String));
         if ($md5String != $params['md5sig']) {
             Mage::throwException('Hash is not valid.');
         }
         // check transaction amount if currency matches
         if ($this->_order->getOrderCurrencyCode() == $params['mb_currency']) {
             if (round($this->_order->getGrandTotal(), 2) != $params['mb_amount']) {
                 Mage::throwException('Transaction amount does not match.');
             }
         }
     }
     return $params;
 }
開發者ID:chucky515,項目名稱:Magento-CE-Mirror,代碼行數:64,代碼來源:Event.php


示例11: getStoreName

 /**
  * Returns the name of the website, store and store view the order was placed in.
  *
  * @param Mage_Sales_Model_Order $order The order to return info from
  * @return String The name of the website, store and store view the order was placed in
  */
 protected function getStoreName($order)
 {
     $storeId = $order->getStoreId();
     if (is_null($storeId)) {
         return $this->getOrder()->getStoreName();
     }
     $store = Mage::app()->getStore($storeId);
     $name = array($store->getWebsite()->getName(), $store->getGroup()->getName(), $store->getName());
     return implode(', ', $name);
 }
開發者ID:rob3000,項目名稱:fontis_australia,代碼行數:16,代碼來源:Abstract.php


示例12: _getStoreIdFromSalesObject

 /**
  * Get store id from quote address or order object
  *
  * @param OnePica_AvaTax_Model_Sales_Quote_Address|Mage_Sales_Model_Order $object
  * @return int|null
  */
 protected function _getStoreIdFromSalesObject($object)
 {
     $storeId = null;
     if ($object instanceof Mage_Sales_Model_Order) {
         $storeId = $object->getStoreId();
     } elseif ($object instanceof OnePica_AvaTax_Model_Sales_Quote_Address) {
         $storeId = $object->getQuote()->getStoreId();
     }
     return $storeId;
 }
開發者ID:onepica,項目名稱:avatax,代碼行數:16,代碼來源:Calculation.php


示例13: toQuote

 /**
  * Converting order object to quote object
  *
  * @param   Mage_Sales_Model_Order $order
  * @return  Mage_Sales_Model_Quote
  */
 public function toQuote(Mage_Sales_Model_Order $order, $quote = null)
 {
     if (!$quote instanceof Mage_Sales_Model_Quote) {
         $quote = Mage::getModel('sales/quote');
     }
     $quote->setStoreId($order->getStoreId())->setOrderId($order->getId());
     Mage::helper('core')->copyFieldset('sales_convert_order', 'to_quote', $order, $quote);
     Mage::dispatchEvent('sales_convert_order_to_quote', array('order' => $order, 'quote' => $quote));
     return $quote;
 }
開發者ID:quyip8818,項目名稱:Mag,代碼行數:16,代碼來源:Order.php


示例14: _getPaymentMethodsAllowed

 /**
  * Certain payment methods require a list of other payment methods that will be used to finalize the payment.
  * This method forms that list
  *
  * @return string
  */
 protected function _getPaymentMethodsAllowed()
 {
     $configAllowed = Mage::getStoreConfig('buckaroo/' . $this->_code . '/allowed_methods', $this->_order->getStoreId());
     $allowedArray = explode(',', $configAllowed);
     if (in_array('all', $allowedArray)) {
         $allowedArray = array('amex', 'directdebit', 'giropay', 'ideal', 'mastercard', 'onlinegiro', 'paypal', 'paysafecard', 'sofortueberweisung', 'transfer', 'visa', 'maestro', 'visaelectron', 'vpay', 'bancontactmrcash');
     }
     $allowedString = implode(',', $allowedArray);
     return $allowedString;
 }
開發者ID:technomagegithub,項目名稱:olgo.nl,代碼行數:16,代碼來源:Abstract.php


示例15: putOrderId

 /**
  * Return the order id or false if order id should not be displayed on document.
  *
  * @param Mage_Sales_Model_Order $order
  * @param string $mode
  * @return mixed
  */
 public function putOrderId(Mage_Sales_Model_Order $order, $mode = 'invoice')
 {
     switch ($mode) {
         case 'invoice':
             if (Mage::getStoreConfigFlag(Mage_Sales_Model_Order_Pdf_Abstract::XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID, $order->getStoreId())) {
                 return $order->getRealOrderId();
             }
             break;
         case 'shipment':
             if (Mage::getStoreConfigFlag(Mage_Sales_Model_Order_Pdf_Abstract::XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID, $order->getStoreId())) {
                 return $order->getRealOrderId();
             }
             break;
         case 'creditmemo':
             if (Mage::getStoreConfigFlag(Mage_Sales_Model_Order_Pdf_Abstract::XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID, $order->getStoreId())) {
                 return $order->getRealOrderId();
             }
             break;
     }
     return false;
 }
開發者ID:thanakrit-promsiri,項目名稱:GermanStoreConfig,代碼行數:28,代碼來源:Data.php


示例16: autoExportJobs

 /** Send order to MailChimp Automatically by Order Status
  *
  *
  */
 public function autoExportJobs()
 {
     $allow_sent = false;
     $orderIds[] = '0';
     $ecommerceOrders = Mage::getModel('monkey/ecommerce')->getCollection()->getData();
     if ($ecommerceOrders) {
         foreach ($ecommerceOrders as $ecommerceOrder) {
             $orderIds[] = $ecommerceOrder['order_id'];
         }
     }
     $orders = Mage::getResourceModel('sales/order_collection');
     //Get ALL orders which has not been sent to MailChimp
     $orders->getSelect()->where('main_table.entity_id NOT IN(?)', $orderIds);
     //Get status options selected in the Configuration
     $states = explode(',', Mage::helper('monkey')->config('order_status'));
     foreach ($orders as $order) {
         foreach ($states as $state) {
             if ($order->getStatus() == $state || $state == 'all_status') {
                 $allow_sent = true;
             }
         }
         if ($allow_sent == true) {
             $this->_order = $order;
             $api = Mage::getSingleton('monkey/api', array('store' => $this->_order->getStoreId()));
             if (!$api) {
                 return false;
             }
             $subtotal = $this->_order->getSubtotal();
             $discount = (double) $this->_order->getDiscountAmount();
             if ($discount != 0) {
                 $subtotal = $subtotal + $discount;
             }
             $this->_info = array('id' => $this->_order->getIncrementId(), 'total' => $subtotal, 'shipping' => $this->_order->getShippingAmount(), 'tax' => $this->_order->getTaxAmount(), 'store_id' => $this->_order->getStoreId(), 'store_name' => $this->_order->getStoreName(), 'plugin_id' => 1215, 'items' => array());
             $email = $this->_order->getCustomerEmail();
             $campaign = $this->_order->getEbizmartsMagemonkeyCampaignId();
             $this->setItemstoSend();
             if ($email && $campaign) {
                 $this->_info['email_id'] = $email;
                 $this->_info['campaign_id'] = $campaign;
                 //Send order to MailChimp
                 $rs = $api->campaignEcommOrderAdd($this->_info);
             } else {
                 $this->_info['email'] = $email;
                 $rs = $api->ecommOrderAdd($this->_info);
             }
             $allow_sent = false;
             if ($rs === TRUE) {
                 $this->_logCall();
             }
         }
     }
 }
開發者ID:technomagegithub,項目名稱:inmed-magento,代碼行數:56,代碼來源:Ecommerce360.php


示例17: getPaymentAction

 /**
  * get payment operation code
  *
  * @param Mage_Sales_Model_Order $order
  *
  * @return string
  */
 public function getPaymentAction($order)
 {
     $operation = Netresearch_OPS_Model_Payment_Abstract::OPS_AUTHORIZE_ACTION;
     // different capture operation name for direct debits
     if ('Direct Debits DE' == $order->getPayment()->getAdditionalInformation('PM') || 'Direct Debits AT' == $order->getPayment()->getAdditionalInformation('PM')) {
         if ('authorize_capture' == Mage::getModel('ops/config')->getPaymentAction($order->getStoreId())) {
             return Netresearch_OPS_Model_Payment_Abstract::OPS_AUTHORIZE_CAPTURE_ACTION;
         }
         return Netresearch_OPS_Model_Payment_Abstract::OPS_AUTHORIZE_ACTION;
     }
     // no RES for Direct Debits NL, so we'll do the final sale
     if ('Direct Debits NL' == $order->getPayment()->getAdditionalInformation('PM')) {
         if ('authorize_capture' == Mage::getModel('ops/config')->getPaymentAction($order->getStoreId())) {
             return Netresearch_OPS_Model_Payment_Abstract::OPS_CAPTURE_DIRECTDEBIT_NL;
         }
         return Netresearch_OPS_Model_Payment_Abstract::OPS_AUTHORIZE_ACTION;
     }
     if ('authorize_capture' == Mage::getModel('ops/config')->getPaymentAction($order->getStoreId())) {
         $operation = Netresearch_OPS_Model_Payment_Abstract::OPS_AUTHORIZE_CAPTURE_ACTION;
     }
     return $operation;
 }
開發者ID:roshu1980,項目名稱:add-computers,代碼行數:29,代碼來源:Quote.php


示例18: toQuote

 /**
  * Converting order object to quote object
  *
  * @param   Mage_Sales_Model_Order $order
  * @return  Mage_Sales_Model_Quote
  */
 public function toQuote(Mage_Sales_Model_Order $order, $quote = null)
 {
     if (!$quote instanceof Mage_Sales_Model_Quote) {
         $quote = AO::getModel('sales/quote');
     }
     $quote->setStoreId($order->getStoreId())->setOrderId($order->getId());
     AO::helper('core')->copyFieldset('sales_convert_order', 'to_quote', $order, $quote);
     //            /**
     //             * Customer data
     //             */
     //            ->setCustomerId($order->getCustomerId())
     //            ->setCustomerEmail($order->getCustomerEmail())
     //            ->setCustomerGroupId($order->getCustomerGroupId())
     //            ->setCustomerTaxClassId($order->getCustomerTaxClassId())
     //            /**
     //             * Not use note from previos order
     //             */
     //            //->setCustomerNote($order->getCustomerNote())
     //            //->setCustomerNoteNotify($order->getCustomerNoteNotify())
     //            ->setCustomerIsGuest($order->getCustomerIsGuest())
     //
     //            /**
     //             * Currency data
     //             */
     //            ->setBaseCurrencyCode($order->getBaseCurrencyCode())
     //            ->setStoreCurrencyCode($order->getStoreCurrencyCode())
     //            ->setQuoteCurrencyCode($order->getOrderCurrencyCode())
     //            ->setStoreToBaseRate($order->getStoreToBaseRate())
     //            ->setStoreToQuoteRate($order->getStoreToOrderRate())
     //
     //            /**
     //             * Totals data
     //             */
     //            ->setGrandTotal($order->getGrandTotal())
     //            ->setBaseGrandTotal($order->getBaseGrandTotal())
     //
     //            /**
     //             * Another data
     //             */
     //            ->setCouponCode($order->getCouponCode())
     //            ->setGiftcertCode($order->getGiftcertCode())
     //            ->setAppliedRuleIds($order->getAppliedRuleIds());
     //            //->collectTotals();
     //
     AO::dispatchEvent('sales_convert_order_to_quote', array('order' => $order, 'quote' => $quote));
     return $quote;
 }
開發者ID:ronseigel,項目名稱:agent-ohm,代碼行數:53,代碼來源:Convert_Order.php


示例19: getCustomerBalanceModelFromSalesEntity

 /**
  * Get customer balance model using sales entity
  *
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $salesEntity
  *
  * @return Enterprise_CustomerBalance_Model_Balance|bool
  */
 public function getCustomerBalanceModelFromSalesEntity($salesEntity)
 {
     if ($salesEntity instanceof Mage_Sales_Model_Order) {
         $customerId = $salesEntity->getCustomerId();
         $quote = $salesEntity->getQuote();
     } elseif ($salesEntity instanceof Mage_Sales_Model_Quote) {
         $customerId = $salesEntity->getCustomer()->getId();
         $quote = $salesEntity;
     } else {
         return false;
     }
     if (!$customerId) {
         return false;
     }
     $customerBalanceModel = Mage::getModel('enterprise_customerbalance/balance')->setCustomerId($customerId)->setWebsiteId(Mage::app()->getStore($salesEntity->getStoreId())->getWebsiteId())->loadByCustomer();
     if ($quote->getBaseCustomerBalanceVirtualAmount() > 0) {
         $customerBalanceModel->setAmount($customerBalanceModel->getAmount() + $quote->getBaseCustomerBalanceVirtualAmount());
     }
     return $customerBalanceModel;
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:27,代碼來源:Data.php


示例20: addOrderToQueue

 /**
  * Add the items from the given order to the Order Sync queue. Does nothing if
  * Order Sync is disabled for the store that the order was placed in.
  *
  * @param Mage_Sales_Model_Order $order
  * @param bool                   $force Skip enabled check
  *
  * @return $this
  */
 public function addOrderToQueue(Mage_Sales_Model_Order $order, $force = false)
 {
     if (!$this->isEnabled($order->getStoreId()) && !$force) {
         return $this;
     }
     $items = array();
     foreach ($order->getAllVisibleItems() as $item) {
         /** @var Mage_Sales_Model_Order_Item $item */
         // For configurable products add children items only, for all other products add parents
         if ($item->getProductType() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {
             foreach ($item->getChildrenItems() as $child) {
                 $items[] = $child->getId();
             }
         } else {
             $items[] = $item->getId();
         }
     }
     $this->addItemsToQueue($items);
     return $this;
 }
開發者ID:shebin512,項目名稱:Magento_Zoff,代碼行數:29,代碼來源:Sync.php



注:本文中的Mage_Sales_Model_Order::getStoreId方法示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。