6 declare(strict_types=1);
29 private $modesMapping = [
30 self::DIMENSION_NONE => [
32 self::DIMENSION_WEBSITE => [
33 WebsiteDimensionProvider::DIMENSION_NAME
35 self::DIMENSION_CUSTOMER_GROUP => [
36 CustomerGroupDimensionProvider::DIMENSION_NAME
38 self::DIMENSION_WEBSITE_AND_CUSTOMER_GROUP => [
39 WebsiteDimensionProvider::DIMENSION_NAME,
40 CustomerGroupDimensionProvider::DIMENSION_NAME
59 $this->scopeConfig = $scopeConfig;
69 return $this->modesMapping;
82 if (
$mode && !isset($this->modesMapping[
$mode])) {
83 throw new \InvalidArgumentException(
84 sprintf(
'Undefined dimension mode "%s".',
$mode)
87 return $this->modesMapping[
$mode ?? $this->getCurrentMode()];
93 private function getCurrentMode(): string
95 if (
null === $this->currentMode) {
100 return $this->currentMode;
__construct(ScopeConfigInterface $scopeConfig)
const DIMENSION_WEBSITE_AND_CUSTOMER_GROUP
const XML_PATH_PRICE_DIMENSIONS_MODE
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
getDimensionConfiguration(string $mode=null)
const DIMENSION_CUSTOMER_GROUP