Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
integration
testsuite
Magento
Sales
_files
order_list.php
Go to the documentation of this file.
1
<?php
7
use
Magento\Sales\Model\Order
;
8
9
require
'order.php'
;
15
$orders
= [
16
[
17
'increment_id'
=>
'100000002'
,
18
'state'
=>
\Magento\Sales\Model\Order::STATE_NEW
,
19
'status'
=>
'processing'
,
20
'grand_total'
=> 120.00,
21
'subtotal'
=> 120.00,
22
'base_grand_total'
=> 120.00,
23
'store_id'
=> 1,
24
'website_id'
=> 1,
25
'payment'
=>
$payment
26
],
27
[
28
'increment_id'
=>
'100000003'
,
29
'state'
=>
\Magento\Sales\Model\Order::STATE_PROCESSING
,
30
'status'
=>
'processing'
,
31
'grand_total'
=> 140.00,
32
'base_grand_total'
=> 140.00,
33
'subtotal'
=> 140.00,
34
'store_id'
=> 0,
35
'website_id'
=> 0,
36
'payment'
=>
$payment
37
],
38
[
39
'increment_id'
=>
'100000004'
,
40
'state'
=>
\Magento\Sales\Model\Order::STATE_PROCESSING
,
41
'status'
=>
'closed'
,
42
'grand_total'
=> 140.00,
43
'base_grand_total'
=> 140.00,
44
'subtotal'
=> 140.00,
45
'store_id'
=> 1,
46
'website_id'
=> 1,
47
'payment'
=>
$payment
48
],
49
];
50
52
foreach
(
$orders
as $orderData) {
54
$order
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
55
\
Magento
\Sales\Model\Order::class
56
);
57
$order
58
->setData($orderData)
59
->addItem(
$orderItem
)
60
->setBillingAddress(
$billingAddress
)
61
->setBillingAddress(
$shippingAddress
)
62
->save();
63
}
Magento\Sales\Model\Order\STATE_NEW
const STATE_NEW
Definition:
Order.php:61
$billingAddress
$billingAddress
Definition:
order.php:25
Magento\Sales\Model\Order
$orderItem
$orderItem
Definition:
order.php:30
$shippingAddress
$shippingAddress
Definition:
order.php:40
$order
$order
Definition:
order.php:55
$payment
$payment
Definition:
order.php:17
$orders
$orders
Definition:
order_list.php:15
Magento
Magento\Sales\Model\Order\STATE_PROCESSING
const STATE_PROCESSING
Definition:
Order.php:65
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125