superskyman100 7 Posted April 29, 2020 Posted April 29, 2020 Hi, I already searched around this forum + google but i have no solution. - Presta 1.7.6.4 - Faceted search 3.5.0 Problem : faceted search doesn't filter attribute stock = 0 - have XXL size for product P1,P2,..., Pn - P1 have stock = 0 for XXL size - in catalog, if i use the filter attribute 'size XXL' the result shows P1..... while P1 doesn't have any stock in XXL..... - the filter shouldn't show the product P1 with size XXL cause there is no stock with this attribute Any fix ? Thanks Share this post Link to post Share on other sites
superskyman100 7 Posted April 30, 2020 Posted April 30, 2020 Anyone here ??? Share this post Link to post Share on other sites
YiannisK 7 Posted June 8, 2020 Posted June 8, 2020 Never-ending "filters" story. This is not solved since I can remember. I did solve it through some forum answers for 1.5 and 1.6 but I can't get it to work for 1.7 Most people ended up buying an expensive module. What was your solution? Share this post Link to post Share on other sites
superskyman100 7 Posted June 8, 2020 Posted June 8, 2020 Ended up like you said... Buying one good module.... Easy Filters... https://www.sunnytoo.com/product/easy-filter-module-for-prestashop1-7 Share this post Link to post Share on other sites
antoniocici 11 Posted January 18 Posted January 18 (edited) After reading a lot of forum topics and GitHub Issues marked as "solved", but solved only for older versions of Prestashop and, mainly, for older versions of the Faceted Search Module, I've found a solution, that works well form me. Since all the queries have been replaced by calls to Search Adapter Objects, I've modified the file: /modules/ps_facetedsearch/src/Product/Search.php at line 147, modifying the source code from this: case 'id_attribute_group': $operationsFilter = []; foreach ($filterValues as $attributeId => $filterValue) { $this->getSearchAdapter()->addOperationsFilter( 'with_attributes_' . $attributeId, [[['id_attribute', $filterValue]]] ); } break; to this: case 'id_attribute_group': $operationsFilter = []; foreach ($filterValues as $attributeId => $filterValue) { $this->getSearchAdapter()->addOperationsFilter( 'with_attributes_' . $attributeId, [[['id_attribute', $filterValue]]] ); } //modded by Antonio to hide Out of Stock combinations $operationsFilter = []; $operationsFilter[] = [ ['quantity', [0], '>'], ]; $this->getSearchAdapter()->addOperationsFilter( self::STOCK_MANAGEMENT_FILTER, $operationsFilter ); break; and finally it works! Edited January 18 by antoniocici (see edit history) 4 Share this post Link to post Share on other sites
YiannisK 7 Posted January 18 Posted January 18 (edited) Tried one more time with a fresh copy of facet module and it worked! Thanks @antoniocici! I really don't understand why the PrestaShop team does not include this to the core. This is a great solution.. Edited January 19 by YiannisK (see edit history) Share this post Link to post Share on other sites
afshop 10 Posted January 22 Posted January 22 On 1/18/2021 at 12:28 PM, antoniocici said: After reading a lot of forum topics and GitHub Issues marked as "solved", but solved only for older versions of Prestashop and, mainly, for older versions of the Faceted Search Module, I've found a solution, that works well form me. Since all the queries have been replaced by calls to Search Adapter Objects, I've modified the file: /modules/ps_facetedsearch/src/Product/Search.php at line 147, modifying the source code from this: case 'id_attribute_group': $operationsFilter = []; foreach ($filterValues as $attributeId => $filterValue) { $this->getSearchAdapter()->addOperationsFilter( 'with_attributes_' . $attributeId, [[['id_attribute', $filterValue]]] ); } break; to this: case 'id_attribute_group': $operationsFilter = []; foreach ($filterValues as $attributeId => $filterValue) { $this->getSearchAdapter()->addOperationsFilter( 'with_attributes_' . $attributeId, [[['id_attribute', $filterValue]]] ); } //modded by Antonio to hide Out of Stock combinations $operationsFilter = []; $operationsFilter[] = [ ['quantity', [0], '>'], ]; $this->getSearchAdapter()->addOperationsFilter( self::STOCK_MANAGEMENT_FILTER, $operationsFilter ); break; and finally it works! Great!!!! Many thanks Angela Share this post Link to post Share on other sites
sandrineparent 0 Posted February 11 Posted February 11 Hi, It's worked for the product lists. But not in the number of available products. For example, in the filter, I have Size 39 (5). And below, I have 4 products because really I have 4 products available in this size. An idea to change that? I mean to have 39 (4)... Thanks Sandrine Share this post Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now