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


PHP Order::load方法代碼示例

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


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

示例1: testCancelAction

 /**
  * @magentoDataFixture Magento/Paypal/_files/quote_payment_standard.php
  * @magentoConfigFixture current_store payment/paypal_standard/active 1
  * @magentoConfigFixture current_store paypal/general/business_account merchant_2012050718_biz@example.com
  */
 public function testCancelAction()
 {
     $quote = $this->_objectManager->create('Magento\\Sales\\Model\\Quote');
     $quote->load('test01', 'reserved_order_id');
     $this->_session->setQuoteId($quote->getId());
     $this->_session->setPaypalStandardQuoteId($quote->getId())->setLastRealOrderId('100000002');
     $this->dispatch('paypal/standard/cancel');
     $this->_order->load('100000002', 'increment_id');
     $this->assertEquals('canceled', $this->_order->getState());
     $this->assertEquals($this->_session->getQuote()->getGrandTotal(), $quote->getGrandTotal());
     $this->assertEquals($this->_session->getQuote()->getItemsCount(), $quote->getItemsCount());
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:17,代碼來源:StandardTest.php

示例2: getOrder

 /**
  * Retrieve order model object
  *
  * @return \Magento\Sales\Model\Order
  */
 public function getOrder()
 {
     if ($this->_order === null) {
         $this->_order = $this->_orderFactory->create();
         if ($this->getOrderId()) {
             $this->_order->load($this->getOrderId());
         }
     }
     return $this->_order;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:15,代碼來源:Quote.php

示例3: request

 /**
  * Get all transactions and orders and return builded data
  *
  * @return array
  */
 public function request()
 {
     //load payments by date
     $this->getPagSeguroAbandoned();
     if ($this->_PagSeguroPaymentList->getTransactions()) {
         foreach ($this->_PagSeguroPaymentList->getTransactions() as $payment) {
             date_default_timezone_set('UTC');
             $order = \UOL\PagSeguro\Helper\Data::getReferenceDecryptOrderID($payment->getReference());
             $order = $this->_order->load($order);
             if ($this->getStoreReference() == \UOL\PagSeguro\Helper\Data::getReferenceDecrypt($payment->getReference())) {
                 if (!is_null($this->_session->getData('store_id'))) {
                     array_push($this->_arrayPayments, $this->build($payment, $order));
                 }
                 if ($order) {
                     array_push($this->_arrayPayments, $this->build($payment, $order));
                 }
             }
         }
     }
     date_default_timezone_set($this->_timezone->getConfigTimezone());
     return $this->_arrayPayments;
 }
開發者ID:pagseguro,項目名稱:magento2,代碼行數:27,代碼來源:Abandoned.php

示例4: addStatusToOrder

 /**
  * Change the magento order status
  *
  * @param $id int of order id
  * @param $status string of payment status
  */
 private function addStatusToOrder($id, $status)
 {
     $order = $this->_order->load($id);
     $order->addStatusToHistory($status, null, true);
     $order->save();
 }
開發者ID:pagseguro,項目名稱:magento2,代碼行數:12,代碼來源:Cancellation.php

示例5: addStatusToOrder

 /**
  * Change the magento order status
  *
  * @param $id int of order id
  * @param $status string of payment status
  */
 private function addStatusToOrder($id, $status)
 {
     $order = $this->_order->load($id);
     $order->addStatusToHistory($this->getStatusFromPaymentKey($status), null, true);
     $order->save();
 }
開發者ID:pagseguro,項目名稱:magento2,代碼行數:12,代碼來源:Conciliation.php


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