-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add ean13 field to api stock management search engine for product and combinations #35505
Conversation
'{product_name} LIKE :keyword_%d OR ' . | ||
'{combination_name} LIKE :keyword_%d' . | ||
')', | ||
$index, | ||
$index, | ||
$index, | ||
$index, | ||
$index, | ||
$index |
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.
at first, I replaced this with an array of fields and a loop to avoid having this list of $index variables...
but it made the whole thing harder to read and understand, and this search engine is already complicated, so I thought it was not worth it
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.
Hello @matthieu-rolland ,
Tested the search of EAN for all types of products in Stocks page.
Search of the exact match is OK ✅ for standard product and combination product (EAN on each combination AND EAN for the whole product)
If I have 2 products with similar EAN, both of the products will be displayed.
For example, I have :
- product A : 123456789
- product B : 12345678
I search for 123456789
, only product A will be displayed.
I search for 12345678
, both of the products will be displayed.
LGTM ✅
Thanks !
nice improvement @matthieu-rolland 👏🏻 |
@@ -311,6 +311,8 @@ protected function having(QueryParamsCollection $queryParams) | |||
return strtr($filters['having'], [ | |||
'{combination_name}' => 'combination_name', | |||
'{product_reference}' => 'product_reference', | |||
'{product_ean13}' => 'product_ean13', |
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.
I have this error if i search one reference in Mvt tab in stock management
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'product_ean13' in 'having clause'
2- Add an EAN code to a specific combination of a product
3- On the stock management page, try searching by ean, it should give you all combinations of a product having the given EAN code, or the specific combination having this EAN if it's the EAN you added on a specific combination.