Skip to content

Commit bc76f59

Browse files
author
Eric Bohanon
committed
Merge remote-tracking branch 'remotes/origin/MAGETWO-81530-support-all-product-types' into MAGETWO-81530-support-all-product-types
2 parents a1c581e + d6605b9 commit bc76f59

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

app/code/Magento/BundleGraphQl/Model/Plugin/Model/Resolver/Products/DataProvider/ProductPlugin.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product;
1212
use Magento\Bundle\Model\Product\OptionList;
1313

14+
/**
15+
* Fetch bundle product object and set necessary extension attributes for search result
16+
*/
1417
class ProductPlugin
1518
{
1619
/**

app/code/Magento/BundleGraphQl/Model/Resolver/Products/DataProvider/Product/Formatter/BundleOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\FormatterInterface;
1212

1313
/**
14-
* Post formatting plugin to continue formatting data for bundle type products
14+
* Post formatting data to set option for bundle product
1515
*/
1616
class BundleOptions implements FormatterInterface
1717
{

app/code/Magento/BundleGraphQl/Model/Resolver/Products/Query/BundleProductPostProcessor.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function process(array $resultData)
8787
$bundleMap[$product['sku']] = [];
8888
foreach ($product['bundle_product_options'] as $optionKey => $option) {
8989
$resultData[$productKey]['items'][$optionKey]
90-
= $this->formatProductOptions($option);
90+
= $option->getData();
9191
/** @var Link $link */
9292
foreach ($option['product_links'] as $link) {
9393
$bundleMap[$product['sku']][] = $link['sku'];
@@ -186,15 +186,4 @@ private function formatBundleAttributes(array $product)
186186
}
187187
return $product;
188188
}
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-
}
200189
}

app/code/Magento/DownloadableGraphQl/Model/Resolver/Products/DataProvider/Product/Formatter/DownloadableOptions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Magento\Downloadable\Model\ResourceModel\Link\Collection as LinkCollection;
1717

1818
/**
19-
* Post formatting plugin to continue formatting data for downloadable type products
19+
* Format for downloadable product types
2020
*/
2121
class DownloadableOptions implements FormatterInterface
2222
{
@@ -59,7 +59,7 @@ public function __construct(
5959
}
6060

6161
/**
62-
* Add downloadable options and options to configurable types
62+
* Add downloadable options to configurable types
6363
*
6464
* {@inheritdoc}
6565
*/
@@ -85,10 +85,10 @@ public function format(Product $product, array $productData = [])
8585
/**
8686
* Format links from collection as array
8787
*
88-
* @param \Magento\Downloadable\Api\Data\LinkInterface[] $links
88+
* @param LinkCollection $links
8989
* @return array
9090
*/
91-
private function formatLinks($links)
91+
private function formatLinks(LinkCollection $links)
9292
{
9393
$resultData = [];
9494
foreach ($links as $linkKey => $link) {

0 commit comments

Comments
 (0)