File tree Expand file tree Collapse file tree 3 files changed +5
-13
lines changed
app/code/Magento/BundleGraphQl/Model
Plugin/Model/Resolver/Products/DataProvider
DataProvider/Product/Formatter Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 11
11
use Magento \CatalogGraphQl \Model \Resolver \Products \DataProvider \Product ;
12
12
use Magento \Bundle \Model \Product \OptionList ;
13
13
14
+ /**
15
+ * Fetch bundle product object and set necessary extension attributes for search result
16
+ */
14
17
class ProductPlugin
15
18
{
16
19
/**
Original file line number Diff line number Diff line change 11
11
use Magento \CatalogGraphQl \Model \Resolver \Products \DataProvider \Product \FormatterInterface ;
12
12
13
13
/**
14
- * Post formatting plugin to continue formatting data for bundle type products
14
+ * Post formatting data to set option for bundle product
15
15
*/
16
16
class BundleOptions implements FormatterInterface
17
17
{
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ public function process(array $resultData)
87
87
$ bundleMap [$ product ['sku ' ]] = [];
88
88
foreach ($ product ['bundle_product_options ' ] as $ optionKey => $ option ) {
89
89
$ resultData [$ productKey ]['items ' ][$ optionKey ]
90
- = $ this -> formatProductOptions ( $ option );
90
+ = $ option -> getData ( );
91
91
/** @var Link $link */
92
92
foreach ($ option ['product_links ' ] as $ link ) {
93
93
$ bundleMap [$ product ['sku ' ]][] = $ link ['sku ' ];
@@ -186,15 +186,4 @@ private function formatBundleAttributes(array $product)
186
186
}
187
187
return $ product ;
188
188
}
189
-
190
- /**
191
- * Format bundle option
192
- *
193
- * @param Option $option
194
- * @return array
195
- */
196
- private function formatProductOptions (Option $ option )
197
- {
198
- return $ option ->getData ();
199
- }
200
189
}
You can’t perform that action at this time.
0 commit comments