-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # composer.json
- Loading branch information
Showing
6 changed files
with
195 additions
and
125 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
This file was deleted.
Oops, something went wrong.
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,68 @@ | ||
<?php | ||
/** | ||
* Mageplaza | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Mageplaza.com license that is | ||
* available through the world-wide-web at this URL: | ||
* https://www.mageplaza.com/LICENSE.txt | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this extension to newer | ||
* version in the future. | ||
* | ||
* @category Mageplaza | ||
* @package Mageplaza_ShopbybrandGraphQl | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Mageplaza\ShopbybrandGraphQl\Plugin\DataProvider\Product; | ||
|
||
use Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Attribute; | ||
use Mageplaza\Shopbybrand\Helper\Data; | ||
|
||
/** | ||
* Class Aggregations | ||
* @package Mageplaza\ShopbybrandGraphQl\Plugin\DataProvider\Product | ||
*/ | ||
class Aggregations | ||
{ | ||
/** | ||
* @var Data | ||
*/ | ||
protected $helperData; | ||
|
||
/** | ||
* Aggregations constructor. | ||
* | ||
* @param Data $helperData | ||
*/ | ||
public function __construct( | ||
Data $helperData | ||
) { | ||
$this->helperData = $helperData; | ||
} | ||
|
||
/** | ||
* @param Attribute $subject | ||
* @param array $results | ||
* | ||
* @return mixed | ||
*/ | ||
public function afterBuild(Attribute $subject, $results) | ||
{ | ||
if ($this->helperData->isEnabled() && $this->helperData->getAttributeCode() && $results) { | ||
foreach ($results as $bucketName => &$data) { | ||
if ($this->helperData->getAttributeCode() === $data['attribute_code']) { | ||
$results[$bucketName]['is_mp_brand'] = true; | ||
} | ||
} | ||
} | ||
|
||
return $results; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
{ | ||
"name": "mageplaza/module-shop-by-brand-graphql", | ||
"description": "Magento 2 Shop By Brand GraphQl Extension", | ||
"type": "magento2-module", | ||
"version": "1.0.3", | ||
"license": "proprietary", | ||
"authors": [ | ||
{ | ||
"name": "Mageplaza", | ||
"email": "[email protected]", | ||
"homepage": "https://www.mageplaza.com", | ||
"role": "Technical Support" | ||
} | ||
], | ||
"autoload": { | ||
"files": [ | ||
"registration.php" | ||
], | ||
"psr-4": { | ||
"Mageplaza\\ShopbybrandGraphQl\\": "" | ||
} | ||
} | ||
} | ||
{ | ||
"name": "mageplaza/module-shop-by-brand-graphql", | ||
"description": "Magento 2 Shop By Brand GraphQl Extension", | ||
"type": "magento2-module", | ||
"version": "1.0.4", | ||
"license": "proprietary", | ||
"authors": [ | ||
{ | ||
"name": "Mageplaza", | ||
"email": "[email protected]", | ||
"homepage": "https://www.mageplaza.com", | ||
"role": "Technical Support" | ||
} | ||
], | ||
"autoload": { | ||
"files": [ | ||
"registration.php" | ||
], | ||
"psr-4": { | ||
"Mageplaza\\ShopbybrandGraphQl\\": "" | ||
} | ||
} | ||
} |
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
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