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
Resolves issue #976 #1144
Resolves issue #976 #1144
Conversation
Allows store owners to specify exactly which products, if any, should be featured, rather than pulling a completely random product.
Works by selecting all product IDs that are featured and then choosing randomly from within that result set, completely removing recursive calls yet getting a valid result on the first try every time in most cases. Since only the product IDs are fetched, memory overhead should be minimal even in the unlikely scenario that a store has thousands of featured products. Efficiency could be optimized even further with an index on the `featured` column.
ac5d051
to
3c4a7dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this remove the random product functionality or allow for both?
It allows for both. The way it works is thus:
|
One thing of note: new products are included in 'latest' but not 'featured' by default. If you'd like them to also be featured by default, I can write up a new PR on top of this one that will do so. |
Funny I was just wondering that. I think for the sake of consistency they should be included by default. |
Alright, give me a few minutes here and I'll have it up for you. |
What a legend. 👍 |
See #1247 |
No description provided.