File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \ConfigurableProductGraphQl \Model \Resolver \Variant ;
9
9
10
+ use Magento \Catalog \Model \Product ;
10
11
use Magento \Framework \GraphQl \Query \Resolver \ContextInterface ;
11
12
use Magento \Framework \GraphQl \Query \Resolver \Value ;
12
13
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
@@ -45,12 +46,14 @@ public function resolve(
45
46
$ data = [];
46
47
foreach ($ value ['options ' ] as $ option ) {
47
48
$ code = $ option ['attribute_code ' ];
48
- if (!isset ($ value ['product ' ]['model ' ][$ code ])) {
49
+ /** @var Product|null $model */
50
+ $ model = $ value ['product ' ]['model ' ] ?? null ;
51
+ if (!$ model || !$ model ->getData ($ code )) {
49
52
continue ;
50
53
}
51
54
52
55
foreach ($ option ['values ' ] as $ optionValue ) {
53
- if ($ optionValue ['value_index ' ] != $ value [ ' product ' ][ ' model ' ][ $ code] ) {
56
+ if ($ optionValue ['value_index ' ] != $ model-> getData ( $ code) ) {
54
57
continue ;
55
58
}
56
59
$ data [] = [
You can’t perform that action at this time.
0 commit comments