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_shipping_address_same_as_billing.php
Go to the documentation of this file.
1
<?php
8
$billingAddress
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
9
\
Magento
\Sales\Model\Order\Address::class,
10
[
11
'data'
=> [
12
'firstname'
=>
'guest'
,
13
'lastname'
=>
'guest'
,
14
'email'
=>
'
[email protected]
'
,
15
'street'
=>
'street'
,
16
'city'
=>
'Los Angeles'
,
17
'region'
=>
'CA'
,
18
'postcode'
=>
'1'
,
19
'country_id'
=>
'US'
,
20
'telephone'
=>
'1'
,
21
]
22
]
23
);
24
$billingAddress
->setAddressType(
'billing'
);
25
26
$shippingAddress
= clone
$billingAddress
;
27
$shippingAddress
->setId(
null
)->setAddressType(
'shipping'
);
28
30
$order
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(\
Magento
\Sales\Model\Order::class);
31
$order
->loadByIncrementId(
'100000001'
);
32
$clonedOrder
= clone
$order
;
33
$order
->setIncrementId(
'100000002'
);
34
$order
->save();
35
37
$payment
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
38
\
Magento
\Sales\Model\Order\Payment::class
39
);
40
$payment
->setMethod(
'checkmo'
);
41
42
$order
=
$clonedOrder
;
43
$order
->setId(
44
null
45
)->setCustomerEmail(
46
'
[email protected]
'
47
)->setBillingAddress(
48
$billingAddress
49
)->setShippingAddress(
50
$shippingAddress
51
)->setPayment(
52
$payment
53
);
54
$order
->save();
$billingAddress
$billingAddress
Definition:
order_shipping_address_same_as_billing.php:8
$shippingAddress
$shippingAddress
Definition:
order_shipping_address_same_as_billing.php:26
$payment
$payment
Definition:
order_shipping_address_same_as_billing.php:37
$clonedOrder
$clonedOrder
Definition:
order_shipping_address_same_as_billing.php:32
Magento
$order
$order
Definition:
order_shipping_address_same_as_billing.php:30
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125