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
Paypal
_files
quote_payflowpro_rollback.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
use
Magento\Catalog\Api\ProductRepositoryInterface
;
9
use
Magento\Framework\Api\SearchCriteriaBuilder
;
10
use
Magento\Framework\ObjectManagerInterface
;
11
use
Magento\Quote\Api\CartRepositoryInterface
;
12
use
Magento\TestFramework\Helper\Bootstrap
;
13
14
require
'fixed_discount_rollback.php'
;
15
17
$objectManager
= Bootstrap::getObjectManager();
18
20
$productRepository
=
$objectManager
->get(ProductRepositoryInterface::class);
22
$productSearchCriteriaBuilder
=
$objectManager
->create(SearchCriteriaBuilder::class);
23
$searchCriteria
=
$productSearchCriteriaBuilder
->addFilter(
'sku'
, [
'simple1'
,
'simple2'
,
'simple3'
],
'in'
)
24
->create();
25
$productList
=
$productRepository
->getList(
$searchCriteria
)->getItems();
26
27
$registry
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->get(\
Magento
\Framework\Registry::class);
28
$registry
->unregister(
'isSecureArea'
);
29
$registry
->register(
'isSecureArea'
,
true
);
30
31
if
(!empty(
$productList
)) {
32
foreach
(
$productList
as
$product
) {
33
$productRepository
->delete(
$product
);
34
}
35
}
36
38
$quoteRepository
=
$objectManager
->get(CartRepositoryInterface::class);
40
$searchCriteriaBuilder
=
$objectManager
->create(SearchCriteriaBuilder::class);
41
$searchCriteria
=
$searchCriteriaBuilder
->addFilter(
'reserved_order_id'
,
'100000015'
)->create();
42
$items
=
$quoteRepository
->getList(
$searchCriteria
)->getItems();
43
44
if
(!empty(
$items
)) {
45
$quote
= array_pop(
$items
);
46
$quoteRepository
->delete(
$quote
);
47
}
48
49
$registry
->unregister(
'isSecureArea'
);
50
$registry
->register(
'isSecureArea'
,
false
);
$productSearchCriteriaBuilder
$productSearchCriteriaBuilder
Definition:
quote_payflowpro_rollback.php:22
$quoteRepository
$quoteRepository
Definition:
quote_payflowpro_rollback.php:38
Magento\Framework\Api\SearchCriteriaBuilder
Definition:
SearchCriteriaBuilder.php:14
Magento\TestFramework\Helper\Bootstrap
Definition:
Bootstrap.php:12
$searchCriteria
$searchCriteria
Definition:
quote_payflowpro_rollback.php:23
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
$quote
$quote
Definition:
paypal_quote.php:17
$items
$items
Definition:
quote_payflowpro_rollback.php:42
$registry
$registry
Definition:
quote_payflowpro_rollback.php:27
$productList
$productList
Definition:
quote_payflowpro_rollback.php:25
Magento\Catalog\Api\ProductRepositoryInterface
Definition:
ProductRepositoryInterface.php:14
$objectManager
$objectManager
Definition:
quote_payflowpro_rollback.php:17
$searchCriteriaBuilder
$searchCriteriaBuilder
Definition:
quote_payflowpro_rollback.php:40
Magento\Quote\Api\CartRepositoryInterface
Definition:
CartRepositoryInterface.php:13
Magento
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
$productRepository
$productRepository
Definition:
quote_payflowpro_rollback.php:20
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125