Skip to content

Commit 3a5185a

Browse files
authored
Merge pull request #4741 from magento-chaika/Chailka-PR-2019-09-06-2.2-2
Chailka-PR-2019-09-06-2.2-2
2 parents 87f4e1e + 3720033 commit 3a5185a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Catalog\Model\Product\Gallery\ReadHandler as GalleryReadHandler;
1515
use Magento\ConfigurableProduct\Model\Product\Type\Collection\SalableProcessor;
1616
use Magento\Framework\App\ObjectManager;
17+
use Magento\Framework\App\State as AppState;
1718
use Magento\Framework\EntityManager\MetadataPool;
1819

1920
/**
@@ -194,6 +195,11 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType
194195
*/
195196
private $salableProcessor;
196197

198+
/**
199+
* @var AppState
200+
*/
201+
private $appState;
202+
197203
/**
198204
* @codingStandardsIgnoreStart/End
199205
*
@@ -217,6 +223,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType
217223
* @param \Magento\Framework\Serialize\Serializer\Json $serializer
218224
* @param ProductInterfaceFactory $productFactory
219225
* @param SalableProcessor $salableProcessor
226+
* @param AppState|null $appState
220227
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
221228
*/
222229
public function __construct(
@@ -241,7 +248,8 @@ public function __construct(
241248
\Magento\Customer\Model\Session $customerSession = null,
242249
\Magento\Framework\Serialize\Serializer\Json $serializer = null,
243250
ProductInterfaceFactory $productFactory = null,
244-
SalableProcessor $salableProcessor = null
251+
SalableProcessor $salableProcessor = null,
252+
AppState $appState = null
245253
) {
246254
$this->typeConfigurableFactory = $typeConfigurableFactory;
247255
$this->_eavAttributeFactory = $eavAttributeFactory;
@@ -256,6 +264,7 @@ public function __construct(
256264
$this->productFactory = $productFactory ?: ObjectManager::getInstance()
257265
->get(ProductInterfaceFactory::class);
258266
$this->salableProcessor = $salableProcessor ?: ObjectManager::getInstance()->get(SalableProcessor::class);
267+
$this->appState = $appState ?? ObjectManager::getInstance()->get(AppState::class);
259268
parent::__construct(
260269
$catalogProductOption,
261270
$eavConfig,
@@ -1246,6 +1255,7 @@ public function getUsedProducts($product, $requiredAttributeIds = null)
12461255
$product->getData($metadata->getLinkField()),
12471256
$product->getStoreId(),
12481257
$this->getCustomerSession()->getCustomerGroupId(),
1258+
$this->appState->getAreaCode(),
12491259
$requiredAttributeIds
12501260
];
12511261
$cacheKey = $this->getUsedProductsCacheKey($keyParts);

0 commit comments

Comments
 (0)