Commit 34ba2d21 authored by Tommy Meier's avatar Tommy Meier
Browse files

Properties were not served in the product search

parent 6a4aa088
# 4.0.1
- [#39041] Eigenschaften wurden in der Suche nicht bereitgestellt
\ No newline at end of file
# 4.0.1
- [#39041] Properties were not served in the product search
\ No newline at end of file
{
"name": "netinventors/next-tool-kit",
"description": "Provides some handy tools for shopware 6",
"version": "4.0.0",
"version": "4.0.1",
"type": "shopware-platform-plugin",
"license": "proprietary",
"authors": [
......
!!!include(../changelog/de/4.0.1.md)!!!
!!!include(../changelog/de/4.0.0.md)!!!
!!!include(../changelog/en/4.0.1.md)!!!
!!!include(../changelog/en/4.0.0.md)!!!
<?php
declare(strict_types=1);
namespace NetInventors\NetiNextToolKit\Decorator;
use Shopware\Core\Content\Product\SalesChannel\Search\AbstractProductSearchRoute;
use Shopware\Core\Content\Product\SalesChannel\Search\ProductSearchRouteResponse;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Symfony\Component\HttpFoundation\Request;
class ProductSearchRouteDecorator extends AbstractProductSearchRoute
{
private AbstractProductSearchRoute $mainService;
public function __construct(
AbstractProductSearchRoute $mainService
) {
$this->mainService = $mainService;
}
public function getDecorated(): AbstractProductSearchRoute
{
return $this->mainService;
}
public function load(
Request $request,
SalesChannelContext $context,
Criteria $criteria
): ProductSearchRouteResponse {
$criteria->addAssociation('properties.group');
$criteria->getAssociation('properties')->addFilter(
new EqualsFilter('group.netiToolKitAttribute.displayInListing', true)
);
return $this->mainService->load($request, $context, $criteria);
}
}
\ No newline at end of file
......@@ -22,5 +22,10 @@
decorates="Shopware\Core\Content\Product\SalesChannel\Listing\ProductListingRoute">
<argument type="service" id="NetInventors\NetiNextToolKit\Decorator\ProductListingRouteDecorator.inner"/>
</service>
<service id="NetInventors\NetiNextToolKit\Decorator\ProductSearchRouteDecorator"
decorates="Shopware\Core\Content\Product\SalesChannel\Search\ProductSearchRoute">
<argument type="service" id="NetInventors\NetiNextToolKit\Decorator\ProductSearchRouteDecorator.inner"/>
</service>
</services>
</container>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment