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-catalog
Model
Indexer
Product
Price
ModeSwitcherConfiguration.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Catalog\Model\Indexer\Product\Price
;
9
10
use
Magento\Framework\App\Config\ConfigResource\ConfigInterface
;
11
use
Magento\Framework\App\Cache\TypeListInterface
;
12
use
Magento\Indexer\Model\Indexer
;
13
17
class
ModeSwitcherConfiguration
18
{
19
const
XML_PATH_PRICE_DIMENSIONS_MODE
=
'indexer/catalog_product_price/dimensions_mode'
;
20
26
private
$configWriter;
27
33
private
$cacheTypeList;
34
38
private
$indexer;
39
45
public
function
__construct
(
46
ConfigInterface
$configWriter,
47
TypeListInterface
$cacheTypeList,
48
Indexer
$indexer
49
) {
50
$this->configWriter =
$configWriter
;
51
$this->cacheTypeList =
$cacheTypeList
;
52
$this->indexer =
$indexer
;
53
}
54
62
public
function
saveMode
(
string
$mode
)
63
{
64
//Change config options
65
$this->configWriter->saveConfig(self::XML_PATH_PRICE_DIMENSIONS_MODE,
$mode
);
66
$this->cacheTypeList->cleanType(
'config'
);
67
$this->indexer->load(\
Magento
\Catalog\Model\
Indexer
\
Product
\
Price
\
Processor::INDEXER_ID
);
68
$this->indexer->invalidate();
69
}
70
}
$configWriter
$configWriter
Definition:
enabled_subscription_with_invalid_token.php:13
Magento\Catalog\Model\Indexer\Product\Price
Definition:
Price.php:10
Magento\Catalog\Model\Indexer\Product\Price
Magento\Catalog\Model\Indexer\Product\Price\ModeSwitcherConfiguration\XML_PATH_PRICE_DIMENSIONS_MODE
const XML_PATH_PRICE_DIMENSIONS_MODE
Definition:
ModeSwitcherConfiguration.php:19
Magento\Catalog\Model\Indexer\Product\Price\Processor\INDEXER_ID
const INDEXER_ID
Definition:
Processor.php:17
Magento\Catalog\Model\Product
Definition:
Product.php:42
$mode
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
Definition:
grid.phtml:15
Magento\Catalog\Model\Indexer\Product\Price\ModeSwitcherConfiguration\__construct
__construct(ConfigInterface $configWriter, TypeListInterface $cacheTypeList, Indexer $indexer)
Definition:
ModeSwitcherConfiguration.php:45
Magento
Magento\Framework\App\Cache\TypeListInterface
Definition:
TypeListInterface.php:12
Magento\Indexer\Model\Indexer
Definition:
Collection.php:6
Magento\Catalog\Model\Indexer\Product\Price\ModeSwitcherConfiguration
Definition:
ModeSwitcherConfiguration.php:17
Magento\Indexer\Model\Indexer
Definition:
Indexer.php:19
Magento\Framework\App\Config\ConfigResource\ConfigInterface
Definition:
ConfigInterface.php:13
$cacheTypeList
$cacheTypeList
Definition:
all_types_invalidated.php:8
$indexer
$indexer
Definition:
product_different_store_prices.php:21
Magento\Catalog\Model\Indexer\Product\Price\ModeSwitcherConfiguration\saveMode
saveMode(string $mode)
Definition:
ModeSwitcherConfiguration.php:62