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
module-paypal
Model
Express
QuotePlugin.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Paypal\Model\Express
;
7
8
use
Magento\Quote\Model\QuoteRepository\SaveHandler
;
9
use
Magento\Quote\Api\Data\CartInterface
;
10
use Magento\Quote\Model\Quote\ProductOptionFactory;
11
18
class
QuotePlugin
19
{
23
private
$productOptionFactory;
24
28
public
function
__construct
(
29
ProductOptionFactory $productOptionFactory
30
) {
31
$this->productOptionFactory = $productOptionFactory;
32
}
33
43
public
function
beforeSave
(
SaveHandler
$subject,
CartInterface
$quote
)
44
{
45
if
(!
$quote
->getIsActive()) {
46
$items
=
$quote
->getItems();
47
48
if
(
$items
) {
49
foreach
(
$items
as
$item
) {
51
if
(!
$item
->isDeleted()) {
52
$item
->setProductOption($this->productOptionFactory->create());
53
}
54
}
55
}
56
}
57
58
return
[
$quote
];
59
}
60
}
Magento\Quote\Api\Data\CartInterface
Definition:
CartInterface.php:13
Magento\Paypal\Model\Express\QuotePlugin\__construct
__construct(ProductOptionFactory $productOptionFactory)
Definition:
QuotePlugin.php:28
$quote
$quote
Definition:
paypal_quote.php:17
Magento\Paypal\Model\Express
Definition:
CheckoutTest.php:6
$item
$item
Definition:
partial_invoice.php:27
Magento\Quote\Model\QuoteRepository\SaveHandler
Definition:
SaveHandler.php:14
Magento\Framework\Model\AbstractModel\beforeSave
beforeSave()
Definition:
AbstractModel.php:689
Magento\Paypal\Model\Express\QuotePlugin
Definition:
QuotePlugin.php:18
$items
$items
Definition:
order_rollback.php:21