File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments