本文整理汇总了PHP中Mage_Sales_Model_Order::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order::load方法的具体用法?PHP Mage_Sales_Model_Order::load怎么用?PHP Mage_Sales_Model_Order::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order::load方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());
}
示例2: getOrder
/**
* Retrieve order model object
*
* @return Mage_Sales_Model_Order
*/
public function getOrder()
{
if (is_null($this->_order)) {
$this->_order = Mage::getModel('sales/order');
if ($this->getOrderId()) {
$this->_order->load($this->getOrderId());
}
}
return $this->_order;
}
示例3: setUp
public function setUp()
{
parent::setUp();
$order = new Mage_Sales_Model_Order();
$order->load('100000001', 'increment_id');
$order->getPayment()->setMethod(Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK);
$order->save();
$session = Mage::getSingleton('Mage_Checkout_Model_Session');
$session->setLastRealOrderId($order->getRealOrderId())->setLastQuoteId($order->getQuoteId());
}
示例4: _getOrder
/**
* Get Order by quoteId
*
* @return Mage_Sales_Model_Order
*/
protected function _getOrder()
{
if (is_null($this->_order)) {
$this->_order = Mage::getModel('Mage_Sales_Model_Order');
$this->_order->load($this->getOnepage()->getQuote()->getId(), 'quote_id');
if (!$this->_order->getId()) {
throw new Mage_Payment_Model_Info_Exception(Mage::helper('Mage_Core_Helper_Data')->__("Can not create invoice. Order was not found."));
}
}
return $this->_order;
}
示例5: testRedirectActionIsContentGenerated
public function testRedirectActionIsContentGenerated()
{
$order = new Mage_Sales_Model_Order();
$order->load('100000001', 'increment_id');
$order->getPayment()->setMethod(Mage_Paypal_Model_Config::METHOD_WPS);
$order->save();
$session = Mage::getSingleton('Mage_Checkout_Model_Session');
$session->setLastRealOrderId($order->getRealOrderId())->setLastQuoteId($order->getQuoteId());
$this->dispatch('paypal/standard/redirect');
$this->assertContains('<form action="https://www.paypal.com/webscr" id="paypal_standard_checkout"' . ' name="paypal_standard_checkout" method="POST">', $this->getResponse()->getBody());
}
示例6: testCancelActionIsContentGenerated
public function testCancelActionIsContentGenerated()
{
$order = new Mage_Sales_Model_Order();
$order->load('100000001', 'increment_id');
$order->getPayment()->setMethod(Mage_Paypal_Model_Config::METHOD_HOSTEDPRO);
$order->save();
$session = Mage::getSingleton('Mage_Checkout_Model_Session');
$session->setLastRealOrderId($order->getRealOrderId())->setLastQuoteId($order->getQuoteId());
$this->dispatch('paypal/hostedpro/cancel');
$this->assertContains('window.top.checkout.gotoSection("payment");', $this->getResponse()->getBody());
$this->assertContains('window.top.document.getElementById(\'checkout-review-submit\').show();', $this->getResponse()->getBody());
$this->assertContains('window.top.document.getElementById(\'iframe-warning\').hide();', $this->getResponse()->getBody());
}
示例7: load
public function load($id, $field = null)
{
parent::load($id, $field);
if (!$this->getId()) {
if (is_null($field)) {
$field = $this->getResource()->getIdFieldName();
}
$mongoOrder = $this->_getMongo()->loadOrder($id, $field);
if ($mongoOrder->getId()) {
$this->setData($mongoOrder->getOrder());
}
}
return $this;
}
示例8: saveOrderPrescriptionExemption
public function saveOrderPrescriptionExemption(Varien_Event_Observer $observer)
{
$exemption = Mage::getSingleton("core/session")->getPrescriptionExemptionCheck();
if ($exemption > 0) {
$exemptions = Mage::getResourceModel('prescriptioncheckout/prescription_collection');
foreach ($exemptions as $ex) {
if ($ex->getID() == $exemption) {
$exemptionText = '<b>' . $ex->getTitle() . '</b>: ' . $ex->getDescriptions();
}
}
$orderIds = $observer->getData('order_ids');
foreach ($orderIds as $orderId) {
$order = new Mage_Sales_Model_Order();
$order->load($orderId);
$order->setData('prescription_exemption', $exemptionText);
$order->save();
}
Mage::getSingleton('core/session')->getPrescriptionExemptionCheck('');
}
}
示例9: getLastSessionOrder
public function getLastSessionOrder()
{
$order = new Mage_Sales_Model_Order();
$orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
return $order->load($orderId);
}
示例10: testProcessIpnRequestRecurringCurrency
/**
* Test processIpnRequest() currency check for recurring profile
*
* @param string $currencyCode
* @dataProvider currencyProvider
* @magentoDataFixture Mage/Paypal/_files/recurring_profile.php
* @magentoConfigFixture current_store payment/paypal_direct/active 1
* @magentoConfigFixture current_store payment/paypal_express/active 1
* @magentoConfigFixture current_store paypal/general/merchant_country US
* @magentoConfigFixture current_store sales_email/order/enabled 0
*/
public function testProcessIpnRequestRecurringCurrency($currencyCode)
{
$ipnData = (require __DIR__ . '/../_files/ipn_recurring_profile.php');
$ipnData['mc_currency'] = $currencyCode;
$this->_model->processIpnRequest($ipnData, $this->_createMockedHttpAdapter());
$recurringProfile = new Mage_Sales_Model_Recurring_Profile();
$recurringProfile->loadByInternalReferenceId('5-33949e201adc4b03fbbceafccba893ce');
$orderIds = $recurringProfile->getChildOrderIds();
$this->assertEquals(1, count($orderIds));
$order = new Mage_Sales_Model_Order();
$order->load($orderIds[0]);
$this->_assertOrder($order, $currencyCode);
}