From 8ce8e17a1bd2d63c96a85dcd21cb4905eb342bfb Mon Sep 17 00:00:00 2001 From: Steve Tentrop Date: Tue, 3 Dec 2024 11:54:28 +0100 Subject: [PATCH] add filtering to set components --- src/Api/Resources/VariationResource.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Api/Resources/VariationResource.php b/src/Api/Resources/VariationResource.php index 481352dd5..f5e76ebf7 100644 --- a/src/Api/Resources/VariationResource.php +++ b/src/Api/Resources/VariationResource.php @@ -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; @@ -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);