Skip to content

Commit 612439f

Browse files
committed
Merge branch '2.11.x'
2 parents eb34bcc + 8bc4147 commit 612439f

22 files changed

Lines changed: 369 additions & 38 deletions

File tree

.github/workflows/02-phpstan.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,22 @@ jobs:
3939
- php-versions: '8.3'
4040
magento-versions: '2.4.7-p8'
4141
magento-editions: 'enterprise'
42-
experimental: true
42+
experimental: false
4343
- php-versions: '8.3'
4444
magento-versions: '2.4.8-p3'
4545
magento-editions: 'enterprise'
46-
experimental: true
46+
experimental: false
4747
- php-versions: '8.4'
4848
magento-versions: '2.4.8-p3'
4949
magento-editions: 'enterprise'
50+
experimental: false
51+
- php-versions: '8.4'
52+
magento-versions: '2.4.9-beta1'
53+
magento-editions: 'enterprise'
54+
experimental: true
55+
- php-versions: '8.5'
56+
magento-versions: '2.4.9-beta1'
57+
magento-editions: 'enterprise'
5058
experimental: true
5159

5260
continue-on-error: ${{ matrix.experimental }}

.github/workflows/20-integration.yml

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,54 +130,90 @@ jobs:
130130
magento-editions: 'community'
131131
db: 'mysql80'
132132
engine: 'opensearch2'
133-
experimental: true
133+
experimental: false
134134
- php-versions: '8.3'
135135
magento-versions: '2.4.8-p3'
136136
magento-editions: 'enterprise'
137137
db: 'mysql80'
138138
engine: 'opensearch2'
139-
experimental: true
139+
experimental: false
140140
- php-versions: '8.3'
141141
magento-versions: '2.4.8-p3'
142142
magento-editions: 'enterprise'
143143
db: 'mysql84'
144144
engine: 'opensearch2'
145-
experimental: true
145+
experimental: false
146146
- php-versions: '8.3'
147147
magento-versions: '2.4.8-p3'
148148
magento-editions: 'enterprise'
149149
db: 'mysql84'
150150
engine: 'opensearch3'
151-
experimental: true
151+
experimental: false
152152
- php-versions: '8.4'
153153
magento-versions: '2.4.8-p3'
154154
magento-editions: 'community'
155155
db: 'mysql80'
156156
engine: 'opensearch2'
157-
experimental: true
157+
experimental: false
158158
- php-versions: '8.4'
159159
magento-versions: '2.4.8-p3'
160160
magento-editions: 'enterprise'
161161
db: 'mysql80'
162162
engine: 'opensearch2'
163-
experimental: true
163+
experimental: false
164164
- php-versions: '8.4'
165165
magento-versions: '2.4.8-p3'
166166
magento-editions: 'enterprise'
167167
db: 'mysql80'
168168
engine: 'opensearch3'
169-
experimental: true
169+
experimental: false
170170
- php-versions: '8.4'
171171
magento-versions: '2.4.8-p3'
172172
magento-editions: 'enterprise'
173173
db: 'mysql84'
174174
engine: 'opensearch2'
175-
experimental: true
175+
experimental: false
176176
- php-versions: '8.4'
177177
magento-versions: '2.4.8-p3'
178178
magento-editions: 'enterprise'
179179
db: 'mysql84'
180180
engine: 'opensearch3'
181+
experimental: false
182+
- php-versions: '8.4'
183+
magento-versions: '2.4.9-beta1'
184+
magento-editions: 'community'
185+
db: 'mysql80'
186+
engine: 'opensearch3'
187+
experimental: true
188+
- php-versions: '8.5'
189+
magento-versions: '2.4.9-beta1'
190+
magento-editions: 'community'
191+
db: 'mysql80'
192+
engine: 'opensearch3'
193+
experimental: true
194+
- php-versions: '8.4'
195+
magento-versions: '2.4.9-beta1'
196+
magento-editions: 'enterprise'
197+
db: 'mysql80'
198+
engine: 'opensearch3'
199+
experimental: true
200+
- php-versions: '8.5'
201+
magento-versions: '2.4.9-beta1'
202+
magento-editions: 'enterprise'
203+
db: 'mysql80'
204+
engine: 'opensearch3'
205+
experimental: true
206+
- php-versions: '8.4'
207+
magento-versions: '2.4.9-beta1'
208+
magento-editions: 'enterprise'
209+
db: 'mysql84'
210+
engine: 'opensearch3'
211+
experimental: true
212+
- php-versions: '8.5'
213+
magento-versions: '2.4.9-beta1'
214+
magento-editions: 'enterprise'
215+
db: 'mysql84'
216+
engine: 'opensearch3'
181217
experimental: true
182218

183219
continue-on-error: ${{ matrix.experimental }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* DISCLAIMER
4+
*
5+
* Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer versions in the future.
6+
*
7+
* @category Smile
8+
* @package Smile\ElasticsuiteCatalog
9+
* @author Vadym Honcharuk <[email protected]>
10+
* @copyright 2026 Smile
11+
* @license Open Software License ("OSL") v. 3.0
12+
*/
13+
14+
namespace Smile\ElasticsuiteCatalog\Api\Layer\Filter;
15+
16+
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
17+
18+
/**
19+
* Filter type provider interface.
20+
*
21+
* @category Smile
22+
* @package Smile\ElasticsuiteCatalog
23+
* @author Vadym Honcharuk <[email protected]>
24+
*/
25+
interface TypeProviderInterface
26+
{
27+
/**
28+
* Return filter class name.
29+
*
30+
* @param Attribute $attribute The attribute model.
31+
* @param string $originalFilterClassName The original/default filter class name.
32+
*
33+
* @return string
34+
*/
35+
public function getFilterClassName(Attribute $attribute, string $originalFilterClassName): string;
36+
}

src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ protected function getFieldFormat()
163163

164164
$attribute = $this->getFilter()->getAttributeModel();
165165

166-
$format['pattern'] = (string) $attribute->getDisplayPattern();
166+
$format['pattern'] = str_replace('%%', '%', (string) $attribute->getDisplayPattern());
167167
$format['precision'] = (int) $attribute->getDisplayPrecision();
168168
$format['requiredPrecision'] = (int) $attribute->getDisplayPrecision();
169169
$format['integerRequired'] = (int) $attribute->getDisplayPrecision() > 0;

src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ private function addDisplayFields(Fieldset $fieldset)
517517
[
518518
'name' => 'display_pattern',
519519
'label' => __('Display pattern'),
520-
'note' => __('A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 €'),
520+
'note' => __('A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 € or %s%% => 20%'),
521521
]
522522
);
523523

src/module-elasticsuite-catalog/Model/Layer/Filter/Decimal.php

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
namespace Smile\ElasticsuiteCatalog\Model\Layer\Filter;
1515

16+
use Magento\Framework\Exception\LocalizedException;
1617
use Smile\ElasticsuiteCatalog\Model\Search\Request\Field\Mapper as RequestFieldMapper;
1718

1819
/**
@@ -110,23 +111,35 @@ protected function _renderRangeLabel($fromValue, $toValue)
110111
/**
111112
* Retrieve ES filter field.
112113
*
113-
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)
114-
*
115114
* @return string
115+
* @throws LocalizedException
116116
*/
117-
private function getFilterField()
117+
protected function getFilterField()
118118
{
119119
return $this->requestFieldMapper->getMappedFieldName(
120120
$this->getAttributeModel()->getAttributeCode()
121121
);
122122
}
123123

124+
/**
125+
* Create the proper query filter for price, according to current customer group Id.
126+
*
127+
* @param array $bounds The price bounds to apply
128+
*
129+
* @return array
130+
*/
131+
protected function getRangeCondition($bounds)
132+
{
133+
return $bounds;
134+
}
135+
124136
/**
125137
* Format value according to attribute display options
126138
*
127139
* @param mixed $value The value to format
128140
*
129141
* @return string
142+
* @throws LocalizedException
130143
*/
131144
private function formatValue($value)
132145
{
@@ -145,18 +158,4 @@ private function formatValue($value)
145158

146159
return $value;
147160
}
148-
149-
/**
150-
* Create the proper query filter for price, according to current customer group Id.
151-
*
152-
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)
153-
*
154-
* @param array $bounds The price bounds to apply
155-
*
156-
* @return array
157-
*/
158-
private function getRangeCondition($bounds)
159-
{
160-
return $bounds;
161-
}
162161
}

src/module-elasticsuite-catalog/Model/Layer/FilterList.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
namespace Smile\ElasticsuiteCatalog\Model\Layer;
1616

17+
use Magento\Catalog\Model\Config\LayerCategoryConfig;
18+
use Magento\Catalog\Model\Layer\FilterableAttributeListInterface;
19+
use Magento\Framework\ObjectManagerInterface;
20+
use Smile\ElasticsuiteCatalog\Api\Layer\Filter\TypeProviderInterface;
21+
1722
/**
1823
* FilterList customization to support decimal filters.
1924
*
@@ -28,6 +33,37 @@ class FilterList extends \Magento\Catalog\Model\Layer\FilterList
2833
*/
2934
const BOOLEAN_FILTER = 'boolean';
3035

36+
/**
37+
* @var TypeProviderInterface[]
38+
*/
39+
private $filterTypeProviders;
40+
41+
/**
42+
* Constructor.
43+
*
44+
* @param ObjectManagerInterface $objectManager Object manager.
45+
* @param FilterableAttributeListInterface $filterableAttributes Filterable attributes list.
46+
* @param LayerCategoryConfig $layerCategoryConfig Category layer config.
47+
* @param array $filters Core filters array.
48+
* @param array $filterTypeProviders Injected custom type providers.
49+
*/
50+
public function __construct(
51+
ObjectManagerInterface $objectManager,
52+
FilterableAttributeListInterface $filterableAttributes,
53+
LayerCategoryConfig $layerCategoryConfig,
54+
array $filters = [],
55+
array $filterTypeProviders = []
56+
) {
57+
parent::__construct(
58+
$objectManager,
59+
$filterableAttributes,
60+
$layerCategoryConfig,
61+
$filters
62+
);
63+
64+
$this->filterTypeProviders = $filterTypeProviders;
65+
}
66+
3167
/**
3268
* {@inheritDoc}
3369
*/
@@ -45,6 +81,13 @@ protected function getAttributeFilterClass(\Magento\Catalog\Model\ResourceModel\
4581
$filterClassName = $this->filterTypes[self::BOOLEAN_FILTER];
4682
}
4783

84+
// Allow injected providers to override the filter class.
85+
foreach ($this->filterTypeProviders as $provider) {
86+
if ($provider instanceof TypeProviderInterface) {
87+
$filterClassName = $provider->getFilterClassName($attribute, $filterClassName);
88+
}
89+
}
90+
4891
return $filterClassName;
4992
}
5093
}

src/module-elasticsuite-catalog/i18n/de_DE.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"Sort products without value when sorting DESC","Produkte ohne Wert beim Sortieren von DESC sortieren"
2424
"Slider Display Configuration","Slider Anzeigeeinstellungen"
2525
"Display pattern","Anzeigemuster"
26-
"A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 €","Ein Muster wie %s UNIT bei dem %s der Wert ist. z.B.: $%s => $20 oder %s € => 20 €"
26+
"A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 € or %s%% => 20%","Ein Muster wie %s UNIT bei dem %s der Wert ist. z.B.: $%s => $20 oder %s € => 20 € oder %s%% => 20%"
2727
"Display Precision","Darstellungsgenauigkeit"
2828
"The number of digits to use for precision when displaying.","Die Anzahl der Ziffern zur Verfeinerung der Ergebnisse."
2929
"No exact results found for: <b>'%1'</b>. The displayed items are the closest matches.","Wir konnten für: <b>'%1'</b> keine exakten Ergebnisse finden. Die gezeigten Elemente entsprechen den besten Übereinstimmungen."

src/module-elasticsuite-catalog/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Last,Last
2323
"Sort products without value when sorting DESC","Sort products without value when sorting DESC"
2424
"Slider Display Configuration","Slider Display Configuration"
2525
"Display pattern","Display pattern"
26-
"A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 €","A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 €"
26+
"A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 € or %s%% => 20%","A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 € or %s%% => 20%"
2727
"Display Precision","Display Precision"
2828
"The number of digits to use for precision when displaying.","The number of digits to use for precision when displaying."
2929
"No exact results found for: <b>'%1'</b>. The displayed items are the closest matches.","No exact results found for: <b>'%1'</b>. The displayed items are the closest matches."

src/module-elasticsuite-catalog/i18n/fr_FR.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Save,Sauvegarder
2323
"Sort products without value when sorting DESC","Trier les produits sans valeurs lors d'un tri DESC"
2424
"Slider Display Configuration","Slider Display Configuration"
2525
"Display pattern","Display pattern"
26-
"A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 €","A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 €"
26+
"A pattern like %s UNIT where %s is the value. Eg : $%s => $20 or %s € => 20 € or %s%% => 20%","Un motif comme %s UNIT %s est la valeur. Exemple: $%s => $20 ou %s € => 20 € ou %s%% => 20%"
2727
"Display Precision","Display Precision"
2828
"The number of digits to use for precision when displaying.","The number of digits to use for precision when displaying."
2929
"No exact results found for: <b>'%1'</b>. The displayed items are the closest matches.","Aucun résultat exact pour la recherche: <b>'%1'</b>. Nous vous proposons des résultats approchants."

0 commit comments

Comments
 (0)