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
Paypal
_files
order_express.php
Go to the documentation of this file.
1
<?php
7
$addressData
= include
__DIR__
.
'/address_data.php'
;
8
$billingAddress
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
9
\
Magento
\Sales\Model\Order\Address::class,
10
[
'data'
=>
$addressData
]
11
);
12
$billingAddress
->setAddressType(
'billing'
);
13
$shippingAddress
= clone
$billingAddress
;
14
$shippingAddress
->setId(
null
)->setAddressType(
'shipping'
);
15
16
$payment
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
17
\
Magento
\Sales\Model\Order\Payment::class
18
);
19
$payment
->setMethod(\
Magento
\Paypal\Model\Config::METHOD_WPP_EXPRESS);
20
21
$amount
= 100;
22
24
$order
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
Magento
\Sales\Model\Order::class);
25
$order
->setCustomerEmail(
'
[email protected]
'
)
26
->setIncrementId(
'100000001'
)
27
->setSubtotal(
$amount
)
28
->setBaseSubtotal(
$amount
)
29
->setBaseGrandTotal(
$amount
)
30
->setGrandTotal(
$amount
)
31
->setBaseCurrencyCode(
'USD'
)
32
->setCustomerIsGuest(
true
)
33
->setStoreId(1)
34
->setEmailSent(
true
)
35
->setBillingAddress(
$billingAddress
)
36
->setShippingAddress(
$shippingAddress
)
37
->setPayment(
$payment
);
38
$order
->save();
__DIR__
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition:
_bootstrap.php:60
$order
$order
Definition:
order_express.php:24
$amount
$amount
Definition:
order_express.php:21
$addressData
$addressData
Definition:
order_express.php:7
Magento
$payment
$payment
Definition:
order_express.php:16
$billingAddress
$billingAddress
Definition:
order_express.php:8
$shippingAddress
$shippingAddress
Definition:
order_express.php:13
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125