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-inventory-shipping
Test
_files
create_quote_on_default_website_rollback.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
use
Magento\Framework\Api\SearchCriteriaBuilder
;
9
use
Magento\Framework\Registry
;
10
use
Magento\Quote\Api\CartRepositoryInterface
;
11
use
Magento\Quote\Api\Data\CartInterface
;
12
use
Magento\TestFramework\Helper\Bootstrap
;
13
15
$registry
= Bootstrap::getObjectManager()->get(Registry::class);
16
18
$cartRepository
= Bootstrap::getObjectManager()->get(CartRepositoryInterface::class);
20
$searchCriteriaBuilder
= Bootstrap::getObjectManager()->get(SearchCriteriaBuilder::class);
21
22
$searchCriteria
=
$searchCriteriaBuilder
23
->addFilter(
'reserved_order_id'
,
'created_order_for_test'
)
24
->create();
25
26
$registry
->unregister(
'isSecureArea'
);
27
$registry
->register(
'isSecureArea'
,
true
);
28
30
$carts
=
$cartRepository
->getList(
$searchCriteria
)->getItems();
31
foreach
(
$carts
as
$cart
) {
32
$cartRepository
->delete(
$cart
);
33
}
34
35
$registry
->unregister(
'isSecureArea'
);
36
$registry
->register(
'isSecureArea'
,
false
);
$cartRepository
$cartRepository
Definition:
create_quote_on_default_website_rollback.php:18
Magento\Quote\Api\Data\CartInterface
Definition:
CartInterface.php:13
$registry
$registry
Definition:
create_quote_on_default_website_rollback.php:15
Magento\Framework\Api\SearchCriteriaBuilder
Definition:
SearchCriteriaBuilder.php:14
Magento\TestFramework\Helper\Bootstrap
Definition:
Bootstrap.php:12
$carts
$carts
Definition:
create_quote_on_default_website_rollback.php:30
Magento\Quote\Api\CartRepositoryInterface
Definition:
CartRepositoryInterface.php:13
$cart
$cart
Definition:
quote_with_bundle_and_options.php:47
$searchCriteria
$searchCriteria
Definition:
create_quote_on_default_website_rollback.php:22
$searchCriteriaBuilder
$searchCriteriaBuilder
Definition:
create_quote_on_default_website_rollback.php:20
Magento\Framework\Registry
Definition:
Registry.php:18