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_with_multiple_items.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
require
'order.php'
;
11
$objectManager
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
();
12
13
require
__DIR__
.
'/../../../Magento/Catalog/_files/product_simple.php'
;
14
$orderItems
[] = [
15
'product_id'
=>
$product
->getId(),
16
'base_price'
=> 123,
17
'order_id'
=>
$order
->getId(),
18
'price'
=> 123,
19
'row_total'
=> 126,
20
'product_type'
=>
'simple'
21
];
22
23
require
__DIR__
.
'/../../../Magento/Catalog/_files/product_simple_duplicated.php'
;
24
$orderItems
[] = [
25
'product_id'
=>
$product
->getId(),
26
'base_price'
=> 123,
27
'order_id'
=>
$order
->getId(),
28
'price'
=> 123,
29
'row_total'
=> 126,
30
'product_type'
=>
'simple'
31
];
32
33
require
__DIR__
.
'/../../../Magento/Catalog/_files/product_simple_with_full_option_set.php'
;
34
$orderItems
[] = [
35
'product_id'
=>
$product
->getId(),
36
'base_price'
=> 123,
37
'order_id'
=>
$order
->getId(),
38
'price'
=> 123,
39
'row_total'
=> 126,
40
'product_type'
=>
'simple'
41
];
42
43
require
__DIR__
.
'/../../../Magento/Catalog/_files/product_simple_with_url_key.php'
;
44
$orderItems
[] = [
45
'product_id'
=>
$product
->getId(),
46
'base_price'
=> 123,
47
'order_id'
=>
$order
->getId(),
48
'price'
=> 123,
49
'row_total'
=> 126,
50
'product_type'
=>
'simple'
51
];
52
53
require
__DIR__
.
'/../../../Magento/Catalog/_files/product_simple_with_all_fields.php'
;
54
$orderItems
[] = [
55
'product_id'
=>
$product
->getId(),
56
'base_price'
=> 123,
57
'order_id'
=>
$order
->getId(),
58
'price'
=> 123,
59
'row_total'
=> 126,
60
'product_type'
=>
'simple'
61
];
62
63
require
__DIR__
.
'/../../../Magento/Catalog/_files/product_simple_with_custom_attribute.php'
;
64
$orderItems
[] = [
65
'product_id'
=>
$product
->getId(),
66
'base_price'
=> 123,
67
'order_id'
=>
$order
->getId(),
68
'price'
=> 123,
69
'row_total'
=> 126,
70
'product_type'
=>
'simple'
71
];
72
74
foreach
(
$orderItems
as $orderItemData) {
76
$orderItem
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
77
\
Magento
\Sales\Model\Order\Item::class
78
);
79
$orderItem
80
->setData($orderItemData)
81
->save();
82
}
$orderItem
$orderItem
Definition:
order.php:30
$objectManager
$objectManager
Definition:
order_with_multiple_items.php:11
__DIR__
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition:
_bootstrap.php:60
$order
$order
Definition:
order.php:55
Magento
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
$orderItems
$orderItems[]
Definition:
order_with_multiple_items.php:14
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125