Skip to content

Commit ffbcc7e

Browse files
committed
ACP2E-2974
1 parent c6bc830 commit ffbcc7e

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/OptionValueProvider.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,20 @@ class OptionValueProvider
2121
*/
2222
private $connection;
2323

24+
/**
25+
* @var \Magento\Store\Model\StoreManagerInterface
26+
*/
27+
private $storeManager;
2428
/**
2529
* @param ResourceConnection $connection
30+
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
2631
*/
27-
public function __construct(ResourceConnection $connection)
28-
{
32+
public function __construct(
33+
ResourceConnection $connection,
34+
\Magento\Store\Model\StoreManagerInterface $storeManager
35+
) {
2936
$this->connection = $connection->getConnection();
37+
$this->storeManager = $storeManager;
3038
}
3139

3240
/**
@@ -37,11 +45,13 @@ public function __construct(ResourceConnection $connection)
3745
*/
3846
public function get(int $optionId): ?string
3947
{
48+
$storeId = $this->storeManager->getStore()->getId();
4049
$select = $this->connection->select()
41-
->from($this->connection->getTableName('eav_attribute_option_value'), 'value')
50+
->from($this->connection->getTableName('eav_attribute_option_value'), ['store_id', 'value'])
4251
->where('option_id = ?', $optionId);
4352

44-
$result = $this->connection->fetchOne($select);
53+
$records = $this->connection->fetchAssoc($select);
54+
$result = $records[$storeId]['value'];
4555

4656
if ($result !== false) {
4757
return $result;

0 commit comments

Comments
 (0)