-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce PHP endpoints for product filters #1714
Introduce PHP endpoints for product filters #1714
Conversation
06af54f
to
690557d
Compare
e7c390b
to
0db143c
Compare
0db143c
to
5268af2
Compare
|
||
use PrestaShop\Module\PsxMarketingWithGoogle\Repository\ManufacturerRepository; | ||
|
||
class BrandOptionsProvider implements OptionsProviderInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can call it ManufacturerOptionsProvider ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I originally thought. But as we're dealing with Brands on the product filter UI, I wanted to put this name inside the Product Filter
namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checking on the back office shows "Brands" on the interface, only Manufacturer is used on the database, probably for backward compatibility.
a4d42a9
to
75aef33
Compare
ef7472b
to
7a1706f
Compare
70d6090
to
f5f7cdc
Compare
f64c5d7
to
29e1f85
Compare
classes/ProductFilter/FilterApplication/AttributeQueryBuilder/OutOfStockQueryBuilder.php
Show resolved
Hide resolved
tests/unit/ProductFilter/Options/AttributeOptionsProviderTest.php
Outdated
Show resolved
Hide resolved
tests/unit/ProductFilter/Options/AttributeOptionsProviderTest.php
Outdated
Show resolved
Hide resolved
classes/ProductFilter/FilterApplication/AttributeQueryBuilder/FeatureQueryBuilder.php
Show resolved
Hide resolved
classes/ProductFilter/FilterApplication/AttributeQueryBuilder/FeatureQueryBuilder.php
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grâce à mes grandes connaissances PHP & Core, je te donne une bonne étoile pour ce merveilleux travail:
🌟
Toutes mes félicitations 🎉
$checkValueIsNumber($value); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$isSingleValue = isset($filter['value']);
if($isSingleValue) {
$checkValueIsNumber($filter['value']);
} else {
foreach ($filter['values'] as $value) {
$checkValueIsNumber($value);
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current version seems more appropriate to me. Before handling each key, we should check it exists first.
The else
would make the code less readable as we don't understand easily that we can rely on values
if value
is not set.
26d1de9
into
PrestaShopCorp:feature/product-filter
Todo
Does not contain
Retrieve possible options of product filters
{"action":"getProductFilterOptions", "kind": "category"}
Response
{"action":"getProductFilterOptions", "kind": "brand"}
Response
{"action":"getProductFilterOptions", "kind": "attribute"}
Response
{"action":"getProductFilterOptions", "kind": "feature"}
Response
Count products matching provided filters
Request
Response
List products matching provided filters
Request
Response