The items in my featured module are displaying in an order of some sort, but not the order I want.
I thought I could just change the sort order of my products and they would display in the desired order, but they dont.
I've been searching around google and these forums but haven't been able to find a solution.
I came across a few threads which said to change the SORY BY in my getFeaturedProducts() function to sort it by the sort order. But there isn't a SORT BY and I can't figure out how to add it and make it sort.
This is probably something obvious I have missed, but would be grateful if you could point me in the right direction.
Many Thanks
If you take a quick peak at catalog/model/catalog/product.php you'll find the getFeaturedProducts() function.
It doesn't actually sort by anything, so you're just getting them back in the order they went into the database probably. You can add ORDER BY ..... whatever you want to order them by, before the LIMIT text in the db call.
Hope that helps...
It doesn't actually sort by anything, so you're just getting them back in the order they went into the database probably. You can add ORDER BY ..... whatever you want to order them by, before the LIMIT text in the db call.
Hope that helps...
Documentation: OpenCart User Guide
Mods: Total Import PRO | CSV Import PRO | Ecom Tracking | Any Feed | Autosuggest | OpenCart CDN
Thanks for the pointer. I chose to sort by sort-order so that all i had to do was then assign a sort order number to each product in the admin panel and bang i can sort the order of the featured products as I wish and change them quite easily. I used the following code on line 367 of products.php just prior to the word LIMIT -
ORDER BY p.sort_order ASC
That did the trick.
Thanks again one and all
ORDER BY p.sort_order ASC
That did the trick.
Thanks again one and all

Who is online
Users browsing this forum: No registered users and 13 guests