-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from riha112/3267
Bundle label fix for 2.4.3
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* ScandiPWA_CatalogGraphQl | ||
* | ||
* @category ScandiPWA | ||
* @package ScandiPWA_CatalogGraphQl | ||
* @author <[email protected]> | ||
* @copyright Copyright (c) 2018 Scandiweb, Ltd (https://scandiweb.com) | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace ScandiPWA\CatalogGraphQl\Model\Resolver\Product; | ||
|
||
use Magento\Framework\GraphQl\Config\Element\Field; | ||
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; | ||
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; | ||
use Magento\BundleGraphQl\Model\Resolver\Options\Label; | ||
|
||
class BundleLabel extends Label | ||
{ | ||
/** | ||
* @param Field $field | ||
* @param ContextInterface $context | ||
* @param ResolveInfo $info | ||
* @param array|null $value | ||
* @param array|null $args | ||
* @return \Magento\Framework\GraphQl\Query\Resolver\Value|mixed | ||
* @throws \Exception | ||
*/ | ||
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) | ||
{ | ||
if (isset($value['product']) && isset($value['product']['name'])) { | ||
return $value['product']['name']; | ||
} | ||
|
||
return parent::resolve($field, $context, $info, $value, $args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters