-
Beta Was this translation helpful? Give feedback.
Replies: 32 comments 27 replies
-
If you add widget products will be displayed properly, only the counter is wrong, because of the error below.
I'll try to find way to fix it in next days. |
Beta Was this translation helpful? Give feedback.
-
@Bashev just to make it clear for other readers here, your answer regards the counter that is not displayed. The real issue is why "Only in stock products" condition stopped working and doesn't show any products anymore on the widget. I save the content in page builder, save the page but still no products shown even if all are in stock! It was working a couple of days ago. |
Beta Was this translation helpful? Give feedback.
-
Hello @cptX I just checked on the fresh Magento (2.4.5 and 2.4.6) with the default sample data and ES (2.10.14 & 2.11.0) The "Only in stock products" condition is working as expected. There is no any magic (cache) here. Probably, it's a data issue or smth specific to your project/environment. Try to check your logs or enable Debug Mode for ElasticSute and provide us with your query.
Yes, we are aware of this bug, but it's not a priority yet. BR, |
Beta Was this translation helpful? Give feedback.
-
Thanks @vahonc, the problem is I have no clue what happened and broke! I cannot correlate it with any action I did. Can you please give me a hint/guidance what to test, or at least which part of the elasticsuite code is responsible for this condition? |
Beta Was this translation helpful? Give feedback.
-
Are you use the same version of ElasticSuite on both of your environments (2.4.5 and 2.4.6)? Are you sure that everything reindex, all indexes are properly configured, cache cleared, etc? How exactly you changed SKUs (manually or via some script)? Did you try re-saved products after changing their SKUs? Again, did you check Magento logs? BR, |
Beta Was this translation helpful? Give feedback.
-
@vahonc I just realized that in 2.4.5 version 2.10.13.3 is installed. In 2.4.6 version 2.11.0 is installed. |
Beta Was this translation helpful? Give feedback.
-
@cptX, it's very strange, because normally all should work as expected. Probably something wrong with the configuration of your store. Have you tried to add some other conditions, just to test if this functionality is working? Anyway, you could try start to debug it here. Maybe it will help you at least understand what's wrong there. |
Beta Was this translation helpful? Give feedback.
-
All the rest conditions work as expected. Only this one returns no results... Maybe uninstalling and reinstalling the module will help but I don't want to lose the settings... Update 2: I just remembered that I also changed the categories structure if this can explain anything... |
Beta Was this translation helpful? Give feedback.
-
Finally I managed to detect something in the logs: [2023-04-12T19:33:35.226737+00:00] main.CRITICAL: InvalidArgumentException: Class does not exist in /var/www/magento/vendor/magento/module-rule/Model/ConditionFactory.php:50 |
Beta Was this translation helpful? Give feedback.
-
Also strange is that in my composer I have: but in my admin page I see ElasticSuite Open Source ver. 2.11.0 I have updated my composer to "smile/elasticsuite": "^2.11", Nothing changed, problem remains... |
Beta Was this translation helpful? Give feedback.
-
@cptX, does the error which you specified above still occur after all your steps? Are you sure that ElasticSuite is selected as the default Search Engine in Magento BO: Did you run these commands, after
BR, |
Beta Was this translation helpful? Give feedback.
-
Hi @cptX First of all : don't use "^" in your composer requirements, never. Always use "~" And please ensure that you have :
Regards |
Beta Was this translation helpful? Give feedback.
-
@vahonc yes Elasticsuite is the selected engine. Also, I ran all these commands, and I do this every time I change something (I have a script which runs all these commands...) @romainruaud I don't have much experience with composer. I don't remember putting the ^ myself there... Anyway I checked again and now in my composer says ~2.11.0. Probably changed automatically since my update yesterday (deleted smile folder and ran composer update again.) I verify that in my 2.4.5 I have 2.10.13.3 and still works ok. Also, for your information in both setups I have only the following modules from elasticsuite enabled, and it was working fine... Smile_ElasticsuiteCore Any ideas please? |
Beta Was this translation helpful? Give feedback.
-
As I'm completely stuck on this and is the last thing needed to get fixed before publishing my site, I was thinking to downgrade the elasticsuite to 2.10.13 as in my 2.4.5. But I don't want to lose my settings or destroy data in my database. So can you please tell me if I can do this without implications? Will the data be preserved if I downgrade to 2.10.13? |
Beta Was this translation helpful? Give feedback.
-
Hi, the "Enable indexing discount on child products" is available in the latest 2.10 releases. Please share the Elasticsearch query that is generated and triggered in the page where your widget resides. Regards |
Beta Was this translation helpful? Give feedback.
-
I cannot find any SQL query. |
Beta Was this translation helpful? Give feedback.
-
you should see another query with a body (a big JSON body). Maybe clear your cache before refreshing the page. |
Beta Was this translation helpful? Give feedback.
-
Maybe you mean this: [2023-04-14T09:48:54.884275+00:00] main.INFO: curl -XPOST 'http://localhost:9200/electrons_el_catalog_product/_search?pretty=true' -d '{"size":0,"query":{"constant_score":{"filter":{"bool":{"must":[{"bool":{"must":[{"terms":{"stock.is_in_stock":[true],"boost":1}}],"must_not":[],"should":[],"boost":1}},{"terms":{"visibility":[2,4],"boost":1}},{"terms":{"visibility":[2,4],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"aggregations":{"attribute_set_id":{"terms":{"field":"attribute_set_id","size":10000,"order":{"_count":"desc"}}},"indexed_attributes":{"terms":{"field":"indexed_attributes","size":10000,"order":{"_count":"desc"}}}},"track_total_hits":true}' [] [] |
Beta Was this translation helpful? Give feedback.
-
Yes exactly, so the query is correct, and filtering on Did you do a full reindex after "changing your SKUs" ? Regards |
Beta Was this translation helpful? Give feedback.
-
What command does a full reindex? The only command I know and use is |
Beta Was this translation helpful? Give feedback.
-
Yep, that's this one. clean cache and then do a full reindex. |
Beta Was this translation helpful? Give feedback.
-
If I configure the condition like this, it shows all the products. It's like all the products are marked as out of stock, although I checked the database and they are saved as in stock... |
Beta Was this translation helpful? Give feedback.
-
If I downgrade the module from 2.11 to 2.10 do I risk to destroy data? Also, I want to thank all people here for their help and time... I appreciate it! I want to conclude what we have found up to this point:
|
Beta Was this translation helpful? Give feedback.
-
I have some important findings!!! I compared the contents of the indices in elasticsearch between my working 2.4.5 and the non-working 2.4.6 Here is a product stored in 2.4.5: And here is a product stored in 2.4.6:
Any clues how can I fix it? |
Beta Was this translation helpful? Give feedback.
-
I also tried to enabled elasticsearch 7 instead of elasticsuite. Then ran bin/magento indexer:reindex but again the same. |
Beta Was this translation helpful? Give feedback.
-
The Elasticsearch mapping in 2.4.6 is |
Beta Was this translation helpful? Give feedback.
-
I have uninstalled elasticsuite completely and deleted all corresponding tables from db. Then I reinstalled it but problem remains... I still get this error in the logs and the "Only in stock products" condition still not working!
I spent a week searching for a solution without success. Now unfortunately I have to rebuild the whole site from scratch... really disappointed... |
Beta Was this translation helpful? Give feedback.
-
Edit this file: change line 50 to:
and see what will be the class name which not exists. This will be the great starting point... Can you show your disabled modules? Do you try to remove (rename) vendor folder and run |
Beta Was this translation helpful? Give feedback.
-
@Bashev thanks for giving your time on this. I really am blind without your help! I just discovered that this error I tried your suggestion to detect the class but this is what I'm getting after modifying line 50 in ConditionFactory.php
This is the list of my disabled modules. The same modules are disabled in my other instances so I don't think this relates to "Only in stock products" condition, but could be related to the error "InvalidArgumentException: Class does not exist in /var/www/electrons_test_02/vendor/magento/module-rule/Model/ConditionFactory.php:50" Magento_AdminAnalytics |
Beta Was this translation helpful? Give feedback.
-
With the help of @Bashev we found that the issue regarding the "Only in stock products" condition not working was not related to the error in the logs. Regarding the error in the logs is a separate issue and will be reported in another bug report. |
Beta Was this translation helpful? Give feedback.
With the help of @Bashev we found that the issue regarding the "Only in stock products" condition not working was not related to the error in the logs.
The problem was that I had copied some databases to make some test instances and in the copied databases in Views > inventory_stock_1 there were references to the original database and not the current... This was confusing the system thinging some products were in stock instead of out of stock...
Regarding the error in the logs is a separate issue and will be reported in another bug report.