Skip to content

Commit

Permalink
add filtering to set components
Browse files Browse the repository at this point in the history
  • Loading branch information
stentrop committed Dec 3, 2024
1 parent 32c5572 commit 8ce8e17
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Api/Resources/VariationResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace IO\Api\Resources;

use IO\Services\TemplateConfigService;
use Plenty\Modules\Webshop\ItemSearch\Helpers\ResultFieldTemplate;
use Plenty\Modules\Webshop\ItemSearch\SearchPresets\SingleItem;
use Plenty\Modules\Webshop\ItemSearch\SearchPresets\VariationList;
Expand Down Expand Up @@ -55,9 +56,11 @@ public function index(): Response

$resultFieldTemplate = $this->request->get('resultFieldTemplate', '');
if (strlen($resultFieldTemplate)) {
/** @var TemplateConfigService $templateConfigService */
$templateConfigService = pluginApp(TemplateConfigService::class);
$searchFactory->withResultFields(
ResultFieldTemplate::load('Webshop.ResultFields.' . $resultFieldTemplate)
);
)->withReducedManufacturerData($templateConfigService->get('item.manufacturer_data', 'all'));
}

$variations = $itemSearchService->getResults($searchFactory);
Expand Down

0 comments on commit 8ce8e17

Please sign in to comment.