I am coming up on a project, and I have a couple other projects that would benefit from having the ability to push products to the bottom of a product lists based on a product field, basically sorting.
My first thought would be to bring in the data and separate the 2 sets into 2 different arrays. Iterate through the in-stock array first then, iterate through the out-of-stock array afterwords. But that seems like a performance prohibitive way of doing it.
Plus if we wanted to do pagination I don't think my solution would work properly.
I need to be able to sort the data by the out of stock field, and I am not sure that is possible.
A module would be fine as well.
Does anyone have a more elegant solution?
Thanks for everyone's help!
My first thought would be to bring in the data and separate the 2 sets into 2 different arrays. Iterate through the in-stock array first then, iterate through the out-of-stock array afterwords. But that seems like a performance prohibitive way of doing it.
Plus if we wanted to do pagination I don't think my solution would work properly.
I need to be able to sort the data by the out of stock field, and I am not sure that is possible.
A module would be fine as well.
Does anyone have a more elegant solution?
Thanks for everyone's help!
Comment