Skip to content

Conversation

@rafaelmerlotto
Copy link

The all_products_except(product_ids) method in the TaxonCustomQueries module was returning products with available_on set to nil. This caused products that are not yet available to show in "You May Also Like" section on the product page.

Solution:
Updated the method to exclude products with available_on = nil

Copy link
Member

@jarednorman jarednorman left a comment

Choose a reason for hiding this comment

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

I think we should use the available scope.

@rafaelmerlotto
Copy link
Author

Thanks for the feedback.

Using available scope is definitely cleaner. I've updated the PR to use:
all_products.available.where.not(id: products_ids)

This ensures the method returns only true available products in the section You May Also Like.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants