Skip to content
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

[16.0][IMP] website_sale_product_assortment: Fix the behavior of the website's search function for product assortments. #1023

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

SuShanVoong
Copy link

Description:

An issue has been identified in the website's search behavior related to the visibility settings for unavailable products. Despite having the "Avoid to show non avaible product" option enabled, unavailable products were still appearing in search results. This caused an inconsistent user experience, as attempting to access an unavailable product resulted in a "Page not found" error.

Cases Covered with This Improvement:

  1. The website's search function now correctly filters products from the catalog, ensuring that only available products are displayed when the "Avoid to show non avaible product" option is enabled.
  2. This prevents users from accessing unavailable products, enhancing the browsing experience and eliminating errors related to non-existent pages.

Implemented Solution:

To resolve this issue, modifications were made to the search autocomplete method, implementing .website_sale from WebsiteSale in main.py so that the _get_products_allowed method can be used.

The allowed_product_domain parameter was added to the options, allowing the availability restriction to be properly applied when executing the _search_get_detail function.

This ensures that unavailable products are filtered out before appearing in search results, guaranteeing that the user's selected configuration is correctly enforced.

FL-556-5220

@OCA-git-bot
Copy link
Contributor

Hi @CarlosRoca13,
some modules you are maintaining are being modified, check this out!

@SuShanVoong SuShanVoong force-pushed the 16.0-imp-website_sale_product_assortment branch 2 times, most recently from 5f3354c to 1b4f715 Compare February 17, 2025 13:38
@SuShanVoong
Copy link
Author

Before the changes, the search engine displayed products that were not selected in the assortment.

Grabacion.de.pantalla.desde.2025-02-17.14-07-21.webm

Now it is fixed.

Grabacion.de.pantalla.desde.2025-02-17.14-34-17.webm

@SuShanVoong SuShanVoong force-pushed the 16.0-imp-website_sale_product_assortment branch from 1b4f715 to 7e9186b Compare February 17, 2025 13:40
Copy link
Contributor

@LuisAlejandroS LuisAlejandroS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

@danielduqma danielduqma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SuShanVoong, tested functionally and everything works as expected!

@SuShanVoong SuShanVoong force-pushed the 16.0-imp-website_sale_product_assortment branch from 7e9186b to 5859df7 Compare February 18, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants