Prestashop: Bad handling of product out of stock but available for order in facetedsearch quantity filter.

Created on 2 Apr 2019  路  4Comments  路  Source: PrestaShop/PrestaShop

Describe the bug
When a product has a stock quantity set to 0 but is set as available for order when out of stock, the facetedsearch count it in the available products but when you want to display only the available products, it seems that the module only check the quantity and not the configuration and so the product will not appear.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new product
  2. In quantities, set its quantity to 0
  3. In availability preferences, set to allow orders when out of stock
  4. Associate the product to a category
  5. For this category, enabled the stock filter
  6. Create 2 other products in this category, one with 0 quantity and disallow order when out of stock, one with a quantity > 0
  7. On the front office go to the category page

You should see in the filters :

  • Not available (1)
  • In stock (2)

Which is correct, 1 product not available for order and the others available.

But if you try to filter, the "Not available" option will show 2 products (instead of 1), the two with 0 quantity and the "In stock" option will show 1 product (instead of 2 this time), the only product with a quantity > 0

Additionnal information
PrestaShop version: 1.7.4.3
PHP version: 7.1.27

Bug FO Faceted search Fixed Minor

All 4 comments

Hi @Xarksass,

I manage to reproduce the issue with PS:1.7.5.1.
This issue is added to our bug roadmap.

Thanks!

Same issue with ps_facetedsearch v3.0.3.
https://drive.google.com/file/d/1mIRiX8Gv3CRxpUKXDs8pYqIvaYwvytUQ/view
Thanks!

I think this one is fixed in the latest version.

Hi @PierreRambaud,

Yes, I did not manage to reproduce the issue with PS1.7.5.2 & PS1.7.6.0 & ps_facetedsearch v3.0.5.
In the BO => Shop Parameters => Products Settings => after enabling the Allow ordering of out-of-stock products, we should CLick on the Rebuilt & Clear cache buttons in the configuration page.
https://drive.google.com/file/d/1XCjgoGFOGt7Wo9BUgAfHgZoJqhWHwqQ1/view
I close the issue.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings