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-instant-purchase
Model
QuoteManagement
Purchase.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\InstantPurchase\Model\QuoteManagement
;
7
8
use
Magento\Framework\Exception\LocalizedException
;
9
use
Magento\Quote\Api\CartManagementInterface
;
10
use
Magento\Quote\Api\CartRepositoryInterface
;
11
use
Magento\Quote\Model\Quote
;
12
19
class
Purchase
20
{
24
private
$quoteRepository;
25
29
private
$quoteManagement;
30
36
public
function
__construct
(
37
CartRepositoryInterface
$quoteRepository,
38
CartManagementInterface
$quoteManagement
39
) {
40
$this->quoteRepository =
$quoteRepository
;
41
$this->quoteManagement =
$quoteManagement
;
42
}
43
52
public
function
purchase
(
Quote
$quote
): int
53
{
54
$quote
->collectTotals();
55
$this->quoteRepository->save(
$quote
);
56
$orderId = $this->quoteManagement->placeOrder(
$quote
->getId());
57
return
$orderId;
58
}
59
}
Magento\Framework\Exception\LocalizedException
Definition:
LocalizedException.php:17
Magento\InstantPurchase\Model\QuoteManagement\Purchase
Definition:
Purchase.php:19
Magento\InstantPurchase\Model\QuoteManagement
Definition:
PaymentConfiguration.php:6
$quote
$quote
Definition:
paypal_quote.php:17
Magento\Quote\Api\CartRepositoryInterface
Definition:
CartRepositoryInterface.php:13
Magento\InstantPurchase\Model\QuoteManagement\Purchase\purchase
purchase(Quote $quote)
Definition:
Purchase.php:52
Magento\Quote\Model\Quote
Definition:
AddressTest.php:6
$quoteRepository
$quoteRepository
Definition:
paypal_quote.php:23
Magento\Framework\DB\Platform\Quote
Definition:
Quote.php:13
Magento\InstantPurchase\Model\QuoteManagement\Purchase\__construct
__construct(CartRepositoryInterface $quoteRepository, CartManagementInterface $quoteManagement)
Definition:
Purchase.php:36
Magento\Quote\Api\CartManagementInterface
Definition:
CartManagementInterface.php:15
$quoteManagement
$quoteManagement
Definition:
order_info.php:73