sorting featured items |
Post Reply |
Author | ||
Nothing
Newbie Joined: 02-November-2005 Location: Canada Status: Offline Points: 0 |
Post Options
Thanks(0)
Posted: 08-November-2005 at 4:28pm |
|
We have 5 main (root) categories in our store (many sub categories). The most popular items purchased are from 2 categories. I want to create a featured product page to show only flagged items from one root category at a time. We have a featured product page, and we need it’s functions to stay as they are… any item flagged will be displayed on that page. The page I’m trying to tweak I got from the below link. I’m wondering…. is there any easy solution? many thanks |
||
rightmind
Newbie Joined: 21-December-2005 Location: United States Status: Offline Points: 0 |
Post Options
Thanks(0)
|
|
I've not tried this, but I would think you could use the file from the Developer's Corner submitted by Dan Tang that allows you to display N featured products anywhere...and then modify the SQL statement to only call items from your category. Easiest would be to create a file for each of the categories you are wanting to feature. Currently, that file uses this SQL statement at line 28:
You could modify it to this, which would select all products from your given category regardless of whether or not they are marked to be displayed on the home page (they just have to be marked as "Featured":
Of course, there are other ways to do this like modifying it to check and for the category in the incoming link and then querying based on that. I hope that at least sets you on the right path! |
||
Nothing
Newbie Joined: 02-November-2005 Location: Canada Status: Offline Points: 0 |
Post Options
Thanks(0)
|
|
hi rightmind I got your suggested code working (thanks!) and as far as i can tell, your code displays items from sub categories only - and does not list any items from any categories below it... (hope that made sense) As mentioned, i have 5 main categories, (tools, wi-fi, hardware, software, prints). i'll continue to bang my head on this sql statement. thanks for your help Edited by Nothing - 11-February-2006 at 8:30pm |
||
rightmind
Newbie Joined: 21-December-2005 Location: United States Status: Offline Points: 0 |
Post Options
Thanks(0)
|
|
The INNER-JOIN "connects" the 2 tables in the database and essentially associates the records based on the field that they have in common -- in this case 'categories_products ON products.idProduct = categories_products.idProduct'
I am sure there is a more sophisticated way to do this, but a basic method would be to add an 'OR' to the query:
X, Y, and Z would be replaced with your sub-category numbers. I am sure there is also a way to check for sub-categories off of a root category. However, I am not able to take the time to look for how to do that at the moment. I will give it a try when I can, but it may take me a couple of weeks before I'll have a chance. And I am sure you don't want to wait that long to get this going. |
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |