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_message.php
Go to the documentation of this file.
1
<?php
7
$objectManager
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
();
8
10
$message
=
$objectManager
->create(\
Magento
\GiftMessage\Model\Message::class);
11
$message
->setSender(
'Romeo'
);
12
$message
->setRecipient(
'Mercutio'
);
13
$message
->setMessage(
'I thought all for the best.'
);
14
$message
->save();
15
17
$quote
=
$objectManager
->create(\
Magento
\Quote\Model\Quote::class);
18
$quote
->setData(
19
[
20
'store_id'
=> 1,
21
'is_active'
=> 1,
22
'reserved_order_id'
=>
'message_order_21'
,
23
'gift_message_id'
=>
$message
->getId(),
24
]
25
);
26
$quote
->save();
27
29
$quoteIdMask
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
30
->create(\
Magento
\Quote\Model\QuoteIdMaskFactory::class)
31
->create();
32
$quoteIdMask
->setQuoteId(
$quote
->getId());
33
$quoteIdMask
->setDataChanges(
true
);
34
$quoteIdMask
->save();
$quoteIdMask
$quoteIdMask
Definition:
quote_with_message.php:29
$quote
$quote
Definition:
quote_with_message.php:17
$message
$message
Definition:
quote_with_message.php:10
Magento
$objectManager
$objectManager
Definition:
quote_with_message.php:7
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125