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_item_cart_custom_qty: add visibility management #996

Conversation

LuisAlejandroS
Copy link
Contributor

Description:

In this PR, the visibility of the quantity configurator in the ecommerce product list (Kanban or List View) has been improved by adding a condition to the corresponding view template. The enhancement ensures that the quantity selector is only displayed when the "Quick Add to Cart" button is visible.

Cases covered with this improvement:

  • Ensures the quantity configurator is only shown when the product is eligible for quick addition to the cart.
  • Provides better alignment between product visibility logic and the display of interactive elements in the frontend.

Reproduction Steps:

  1. Create a product in the Sales > Products menu and set the stock to 0.
  2. Make sure the "Allow out of stock order" option is unchecked.
  3. Enable website_sale_product_item_cart_custom_qty module.
  4. In the ecommerce frontend, go to the product listing or Kanban view.
  5. Verify that the "Quantity selector" is hidden when stock is zero

Solution:

The issue was addressed by modifying the view template to include the following condition:
"product._website_show_quick_add()"
This change integrates the logic for visibility of the quantity configurator with the existing _website_show_quick_add method in the product.template model that is modified in website_sale_hide_price.

By introducing this template condition, the visibility of the quantity selector is dynamically managed based on product settings, ensuring consistency and improved user experience.

Here in this example I used Office design software as the product with 0 stock:

image

FL-556-4816

@OCA-git-bot
Copy link
Contributor

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

Copy link

@Pablocce Pablocce 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
Contributor

@CarlosRoca13 CarlosRoca13 left a comment

Choose a reason for hiding this comment

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

Thanks 😄

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-996-by-CarlosRoca13-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 11ad67f into OCA:16.0 Dec 17, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 5b26e08. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants