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


PHP Mage_Sales_Model_Order::getId方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     $orderId = $this->getRequest()->getParam('order_id');
     $this->_order = Mage::getModel('sales/order')->load($orderId);
     $this->_helper = Mage::helper('tig_myparcel');
     $this->_myParcelShipments = Mage::getModel('tig_myparcel/shipment')->getCollection()->addFieldToFilter('order_id', $this->_order->getId());
 }
开发者ID:myparcelnl,项目名称:magento1,代码行数:7,代码来源:ShippingInfo.php

示例2: salesOrderSaveAfter

 /**
  * @param Varien_Event_Observer $observer
  * @return $this
  */
 public function salesOrderSaveAfter($observer)
 {
     $event = $observer->getEvent();
     /** @noinspection PhpUndefinedMethodInspection */
     /** @var Mage_Sales_Model_Order $order_after */
     $order_after = $event->getOrder();
     if ($order_after && $this->_temp_order_before && $order_after->getId() == $this->_temp_order_before->getId()) {
         $order_before = $this->_temp_order_before;
         if ($order_after && $order_before) {
             $status_before = $order_before->getStatus();
             $status_after = $order_after->getStatus();
             $state_before = $order_before->getState();
             $state_after = $order_after->getState();
             $state_changed = $status_before != $status_after || $state_before != $state_after;
             /** @var Payin7_Payments_Model_Payin7orderhistory $mh */
             $mh = Mage::getModel('payin7payments/payin7orderhistory');
             if ($state_changed) {
                 $mh->markOrderStateChanged($order_after);
             } else {
                 $mh->markOrderUpdated($order_after);
             }
             $this->_flushFastOrderHistory();
         }
         $this->_temp_order_before = null;
     }
     return $this;
 }
开发者ID:payin7-payments,项目名称:payin7-magento,代码行数:31,代码来源:Observer.php

示例3: _canViewOrder

 /**
  * Check order view availability
  *
  * @param   Mage_Sales_Model_Order $order
  * @return  bool
  */
 protected function _canViewOrder($order)
 {
     $currentOrder = Mage::registry('current_order');
     if ($order->getId() && $order->getId() === $currentOrder->getId()) {
         return true;
     }
     return false;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:14,代码来源:GuestController.php

示例4: _checkOrderInformation

 /**
  * Checks that there's an valid transaction id for the requested order.
  *
  * @return TRUE if transaction id was found and validated
  * @return FALSE if transaction id was not found or could not be validated
  */
 protected function _checkOrderInformation()
 {
     if (!$this->_order->getId()) {
         Mage::helper('barzahlen')->bzLog('controller/ipn: Unable to find the given order', $this->_receivedData);
         return false;
     }
     $transactionId = isset($this->_receivedData['origin_transaction_id']) ? $this->_receivedData['origin_transaction_id'] : $this->_receivedData['transaction_id'];
     if ($transactionId != $this->_order->getPayment()->getAdditionalInformation('transaction_id')) {
         Mage::helper('barzahlen')->bzLog('controller/ipn: Unable to find the transaction id in the given order', $this->_receivedData);
         return false;
     }
     return true;
 }
开发者ID:KaiBerkemeyer,项目名称:Barzahlen-Magento-1,代码行数:19,代码来源:Ipn.php

示例5: appendPaymentInfoToOrder

 /**
  * @param Mage_Sales_Model_Order $order
  *
  * @return $this
  */
 public function appendPaymentInfoToOrder(Mage_Sales_Model_Order &$order)
 {
     if (!$order->getId()) {
         return $this;
     }
     $bind = array(':order_id' => $order->getId());
     /** @var Magento_Db_Adapter_Pdo_Mysql $read */
     $read = $this->_getReadAdapter();
     $select = $read->select()->from($this->getMainTable(), array('rede_payment_id' => 'payment_id', 'rede_transaction_id' => 'transaction_id'))->where('order_id = :order_id');
     $result = $read->fetchRow($select, $bind);
     if (!$result) {
         return $this;
     }
     $order->addData($result);
     return $this;
 }
开发者ID:marcoescudeiro,项目名称:clickpag-magento,代码行数:21,代码来源:Payments.php

示例6: processPaymentCaptureResponse

 public function processPaymentCaptureResponse(array $request)
 {
     $this->_request = $request;
     $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
     $purchase_id = $this->getRequestData('purchase_id');
     Mage::getSingleton('checkout/session')->setPurchaseId($purchase_id);
     // Load appropriate order
     $this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
     if (!$this->_order->getId()) {
         throw new Exception('Requested order with id ' . $orderId . ' does not exists.');
     }
     $result = array();
     if ($this->_verifyResponse($purchase_id)) {
         // Payment was successful, so update the order's state
         // and send order email and move to the success page
         $result['status'] = 'success';
         $result['redirect_to'] = Mage::getBaseUrl() . 'sign2pay/payment/success';
         $result['params'] = array('purchase_id' => $purchaseId);
         Mage::getSingleton('checkout/session')->setPurchaseId($purchase_id);
         // Register the payment capture
         $this->_registerPaymentCapture();
     } else {
         // Register the payment failure
         $this->_registerPaymentFailure();
     }
     if (!$result) {
         // There is a problem in the response we got
         $result['status'] = 'failure';
         $result['redirect_to'] = Mage::getBaseUrl() . 'sign2pay/payment/failure';
         $result['params'] = array('ref_id' => $orderId, 'message' => Mage::helper('sign2pay')->__('Sorry, but we could not process your payment at this time.'));
     }
     return $result;
 }
开发者ID:ArjenMiedema,项目名称:magento-sign2pay,代码行数:33,代码来源:Processor.php

示例7: _redirectByOrder

 /**
  * @param Mage_Sales_Model_Order $order
  *
  * @return $this
  */
 protected function _redirectByOrder(Mage_Sales_Model_Order $order)
 {
     if (!$order->getId()) {
         $this->_redirectCart();
         return $this;
     }
     if ($order->isCanceled()) {
         $this->_redirectPaymentError();
         return $this;
     }
     switch ($order->getState()) {
         case Mage_Sales_Model_Order::STATE_NEW:
             $this->_redirectOrderPending();
             break;
         case Mage_Sales_Model_Order::STATE_CANCELED:
             $this->_redirectPaymentError();
             break;
         case Mage_Sales_Model_Order::STATE_PROCESSING:
         case Mage_Sales_Model_Order::STATE_COMPLETE:
         case Mage_Sales_Model_Order::STATE_CLOSED:
         case Mage_Sales_Model_Order::STATE_HOLDED:
         case Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW:
         default:
             $this->_redirectOrderState();
             break;
     }
     return $this;
 }
开发者ID:marcoescudeiro,项目名称:clickpag-magento,代码行数:33,代码来源:Action.php

示例8: processOrderConsultStatus

 /**
  * @param Mage_Sales_Model_Order $order
  * @param array                  $result
  *
  * @return string
  */
 public function processOrderConsultStatus(Mage_Sales_Model_Order $order, $status = null, $result = array(), $processType = null)
 {
     $transactionId = isset($result['id']) ? $result['id'] : null;
     if ($result && $transactionId && $order->getId()) {
         /** @var Rede_ClickPag_Model_Payments $payments */
         $payments = Mage::getModel('rede_clickpag/payments')->loadByOrderId($order->getId());
         $payments->setTransactionId($transactionId)->setAdditionalInformation($result)->save();
     }
     if (empty($processType)) {
         $processType = self::PROCESS_TYPE_CONSULT;
     }
     if (!empty($status)) {
         return $this->processOrderStatus($order, $status, $transactionId, $processType);
     }
     return self::REDIRECT_STATE;
 }
开发者ID:marcoescudeiro,项目名称:clickpag-magento,代码行数:22,代码来源:Order.php

示例9: setOrder

 /**
  * @param Mage_Sales_Model_Order $order
  *
  * @return $this
  */
 public function setOrder(Mage_Sales_Model_Order $order)
 {
     if ($order && $order->getId()) {
         $this->_order = $order;
     }
     return $this;
 }
开发者ID:Tracksale,项目名称:tracksale-magento,代码行数:12,代码来源:Connection.php

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

示例11: applyOrder

 public function applyOrder(Mage_Sales_Model_Order $order, $sendEmail = false)
 {
     $this->_order = $order;
     $timestamp = new Zend_Date();
     $this->setOrderId($order->getId())->setIsNotified($sendEmail ? 1 : 0)->setAssignTime($timestamp->toString(Zend_Date::ISO_8601))->save();
     return $this;
 }
开发者ID:rjocoleman,项目名称:magpleasure_assignorder,代码行数:7,代码来源:History.php

示例12: _getButtonsHtml

 protected function _getButtonsHtml(SM_Vendors_Model_Order $vendorOrder, Mage_Sales_Model_Order $order, $vendorId)
 {
     $buttonGroups = array();
     $urlParams = array('order_id' => $order->getId(), 'do_as_vendor' => $vendorId);
     if ($vendorOrder->canCancel()) {
         $message = Mage::helper('sales')->__('Are you sure you want to cancel this order?');
         $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'order_cancel_' . $vendorId, 'label' => Mage::helper('sales')->__('Cancel'), 'onclick' => 'deleteConfirm(\'' . $message . '\', \'' . $this->getUrl('*/vendors_order/cancel', $urlParams) . '\')'));
         $buttonGroups[] = $button->toHtml();
     }
     if ($vendorOrder->canInvoice()) {
         $_label = $order->getForcedDoShipmentWithInvoice() ? Mage::helper('sales')->__('Invoice and Ship') : Mage::helper('sales')->__('Invoice');
         $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'order_invoice_' . $vendorId, 'label' => $_label, 'onclick' => 'setLocation(\'' . $this->getUrl('*/vendors_order_invoice/start', $urlParams) . '\')', 'class' => 'go'));
         $buttonGroups[] = $button->toHtml();
     }
     if ($vendorOrder->canShip() && !$order->getForcedDoShipmentWithInvoice()) {
         $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'order_ship_' . $vendorId, 'label' => Mage::helper('sales')->__('Ship'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/vendors_order_shipment/new', $urlParams) . '\')', 'class' => 'go'));
         $buttonGroups[] = $button->toHtml();
     }
     if ($vendorOrder->canCreditmemo()) {
         $message = Mage::helper('sales')->__('This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you wish to proceed?');
         $urlParams['_current'] = true;
         $creditMemoUrl = $this->getUrl('*/vendors_order_creditmemo/new', $urlParams);
         $onClick = "setLocation('{$creditMemoUrl}')";
         if ($order->getPayment()->getMethodInstance()->isGateway()) {
             $onClick = "confirmSetLocation('{$message}', '{$creditMemoUrl}')";
         }
         $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('id' => 'order_creditmemo_' . $vendorId, 'label' => Mage::helper('sales')->__('Credit Memo'), 'onclick' => $onClick, 'class' => 'go'));
         $buttonGroups[] = $button->toHtml();
     }
     if (!empty($buttonGroups)) {
         return '<p class="form-buttons">' . implode("\n", $buttonGroups) . '</p>';
     } else {
         return '';
     }
 }
开发者ID:shashankkanungo,项目名称:magento,代码行数:35,代码来源:SM_Vendors_Block_Adminhtml_Sales_Order_View_Items.php

示例13: testOrderViewAction

 /**
  * @magentoDataFixture Mage/Sales/_files/order.php
  */
 public function testOrderViewAction()
 {
     $order = new Mage_Sales_Model_Order();
     $order->load('100000001', 'increment_id');
     $this->dispatch('admin/sales_order/view/order_id/' . $order->getId());
     $this->assertContains('Los Angeles', $this->getResponse()->getBody());
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:10,代码来源:OrderController.php

示例14: _canViewOrder

 /**
  * Check order view availability
  *
  * @param   Mage_Sales_Model_Order $order
  * @return  bool
  */
 protected function _canViewOrder($order)
 {
     $customerId = Mage::getSingleton('customer/session')->getCustomerId();
     if ($order->getId() && $order->getCustomerId() && $order->getCustomerId() == $customerId) {
         return true;
     }
     return false;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:14,代码来源:OrderController.php

示例15: setOrder

 /**
  * @param Mage_Sales_Model_Order $order
  *
  * @return $this
  */
 public function setOrder(Mage_Sales_Model_Order $order)
 {
     if (!$order || !$order->getId()) {
         return $this;
     }
     $this->_order = $order;
     return $this;
 }
开发者ID:marcoescudeiro,项目名称:clickpag-magento,代码行数:13,代码来源:Abstract.php


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