feat: multiple storage pids for product teasers and search
This commit is contained in:
@@ -101,10 +101,11 @@ class ProductRepository extends AbstractRepository
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $filterSettings['productsPid']) {
|
if ($filterSettings['productsPid']) {
|
||||||
$qb->andWhere($qb->expr()->eq(
|
$productsPid = $filterSettings['productsPid'];
|
||||||
|
$qb->andWhere($qb->expr()->in(
|
||||||
'date.product_pid',
|
'date.product_pid',
|
||||||
$qb->createNamedParameter($filterSettings['productsPid'], Connection::PARAM_INT))
|
$qb->createNamedParameter($productsPid, Connection::PARAM_INT_ARRAY))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,14 +145,16 @@ class ProductRepository extends AbstractRepository
|
|||||||
->addGroupBy('date.nights')
|
->addGroupBy('date.nights')
|
||||||
->having('available > 0')
|
->having('available > 0')
|
||||||
->orderBy('important', 'DESC')
|
->orderBy('important', 'DESC')
|
||||||
|
->addOrderBy('new', 'DESC')
|
||||||
->addOrderBy('concept_sorting')
|
->addOrderBy('concept_sorting')
|
||||||
->addOrderBy('date_start')
|
->addOrderBy('date_start')
|
||||||
;
|
;
|
||||||
|
|
||||||
if (null !== $filterSettings['productsPid']) {
|
if ($filterSettings['productsPid']) {
|
||||||
$qb->andWhere($qb->expr()->eq(
|
$productsPid = (array) $filterSettings['productsPid'];
|
||||||
|
$qb->andWhere($qb->expr()->in(
|
||||||
'date.product_pid',
|
'date.product_pid',
|
||||||
$qb->createNamedParameter($filterSettings['productsPid'], Connection::PARAM_INT))
|
$qb->createNamedParameter($productsPid, Connection::PARAM_INT_ARRAY))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,10 +229,11 @@ class ProductRepository extends AbstractRepository
|
|||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
if (null !== $filterSettings['productsPid']) {
|
if ($filterSettings['productsPid']) {
|
||||||
$qb->andWhere($qb->expr()->eq(
|
$productsPid = (array) $filterSettings['productsPid'];
|
||||||
|
$qb->andWhere($qb->expr()->in(
|
||||||
'date.product_pid',
|
'date.product_pid',
|
||||||
$qb->createNamedParameter($filterSettings['productsPid'], Connection::PARAM_INT))
|
$qb->createNamedParameter($productsPid, Connection::PARAM_INT_ARRAY))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,10 +282,11 @@ class ProductRepository extends AbstractRepository
|
|||||||
->groupBy('date.date_start')
|
->groupBy('date.date_start')
|
||||||
;
|
;
|
||||||
|
|
||||||
if (null !== $filterSettings['productsPid']) {
|
if ($filterSettings['productsPid']) {
|
||||||
$qb->andWhere($qb->expr()->eq(
|
$productsPid = (array) $filterSettings['productsPid'];
|
||||||
|
$qb->andWhere($qb->expr()->in(
|
||||||
'date.product_pid',
|
'date.product_pid',
|
||||||
$qb->createNamedParameter($filterSettings['productsPid'], Connection::PARAM_INT))
|
$qb->createNamedParameter($productsPid, Connection::PARAM_INT_ARRAY))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class FilterService implements SingletonInterface
|
|||||||
{
|
{
|
||||||
$optionsResolver = new OptionsResolver();
|
$optionsResolver = new OptionsResolver();
|
||||||
$optionsResolver->setDefaults([
|
$optionsResolver->setDefaults([
|
||||||
'productsPid' => null,
|
'productsPid' => [],
|
||||||
'priceRanges' => [],
|
'priceRanges' => [],
|
||||||
'countryUids' => [],
|
'countryUids' => [],
|
||||||
'regionUids' => [],
|
'regionUids' => [],
|
||||||
@@ -37,12 +37,12 @@ class FilterService implements SingletonInterface
|
|||||||
'pax' => 0,
|
'pax' => 0,
|
||||||
'bus' => null,
|
'bus' => null,
|
||||||
]);
|
]);
|
||||||
foreach (['productsPid', 'hotelUid', 'productUid', 'nights', 'pax'] as $key) {
|
foreach (['hotelUid', 'productUid', 'nights', 'pax'] as $key) {
|
||||||
$optionsResolver->setNormalizer($key, function (Options $options, $value) {
|
$optionsResolver->setNormalizer($key, function (Options $options, $value) {
|
||||||
return null !== $value ? (int)$value : null;
|
return null !== $value ? (int)$value : null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
foreach (['priceRanges', 'countryUids', 'regionUids', 'cityUids', 'conceptUids', 'boardTypes', 'hotelTypes', 'roomTypes'] as $key) {
|
foreach (['productsPid', 'priceRanges', 'countryUids', 'regionUids', 'cityUids', 'conceptUids', 'boardTypes', 'hotelTypes', 'roomTypes'] as $key) {
|
||||||
$optionsResolver->setNormalizer($key, function (Options $options, $value) {
|
$optionsResolver->setNormalizer($key, function (Options $options, $value) {
|
||||||
if (empty($value)) {
|
if (empty($value)) {
|
||||||
return [];
|
return [];
|
||||||
@@ -62,7 +62,7 @@ class FilterService implements SingletonInterface
|
|||||||
|
|
||||||
$typoScriptSettings = $this->getTypoScriptSettings();
|
$typoScriptSettings = $this->getTypoScriptSettings();
|
||||||
if (is_array($typoScriptSettings) && isset($typoScriptSettings['productsPid'])) {
|
if (is_array($typoScriptSettings) && isset($typoScriptSettings['productsPid'])) {
|
||||||
$filterSettings['productsPid'] = $typoScriptSettings['productsPid'];
|
$filterSettings['productsPid'] = GeneralUtility::trimExplode(',', $typoScriptSettings['productsPid'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $filterSettings;
|
return $filterSettings;
|
||||||
|
|||||||
Reference in New Issue
Block a user