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
GiftMessage
_files
quote_with_customer_and_message.php
Go to the documentation of this file.
1
<?php
7
require
__DIR__
.
'/../../Customer/_files/customer.php'
;
8
9
$objectManager
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
();
10
12
$customerRepository
=
$objectManager
->create(\
Magento
\Customer\Api\CustomerRepositoryInterface::class);
13
$customer
=
$customerRepository
->getById(1);
14
16
$message
=
$objectManager
->create(\
Magento
\GiftMessage\Model\Message::class);
17
$message
->setSender(
'Romeo'
);
18
$message
->setRecipient(
'Mercutio'
);
19
$message
->setMessage(
'I thought all for the best.'
);
20
$message
->save();
21
23
$quote
=
$objectManager
->create(\
Magento
\Quote\Model\Quote::class);
24
$quote
->setData(
25
[
26
'store_id'
=> 1,
27
'is_active'
=> 1,
28
'reserved_order_id'
=>
'message_order_21'
,
29
'gift_message_id'
=>
$message
->getId(),
30
]
31
)->assignCustomer(
$customer
);
32
$quote
->save();
33
35
$quoteIdMask
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
36
->create(\
Magento
\Quote\Model\QuoteIdMaskFactory::class)
37
->create();
38
$quoteIdMask
->setQuoteId(
$quote
->getId());
39
$quoteIdMask
->setDataChanges(
true
);
40
$quoteIdMask
->save();
$objectManager
$objectManager
Definition:
quote_with_customer_and_message.php:9
$quote
$quote
Definition:
quote_with_customer_and_message.php:23
__DIR__
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition:
_bootstrap.php:60
$customerRepository
$customerRepository
Definition:
quote_with_customer_and_message.php:12
Magento
$customer
$customer
Definition:
quote_with_customer_and_message.php:13
$quoteIdMask
$quoteIdMask
Definition:
quote_with_customer_and_message.php:35
$message
$message
Definition:
quote_with_customer_and_message.php:16
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125