ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - sorting featured items
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

sorting featured items

 Post Reply Post Reply
Author
Message
Nothing View Drop Down
Newbie
Newbie
Avatar

Joined: 02-November-2005
Location: Canada
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nothing Quote  Post ReplyReply Direct Link To This Post Topic: sorting featured items
    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.
“Move the default ProductCart home page (mainIndex.asp) to your root folder. Download this special version of mainIndex.asp - renamed index.asp - which has been modified to work in your root folder.”

I’m wondering…. is there any easy solution?  

many thanks
n0thing

Back to Top
rightmind View Drop Down
Newbie
Newbie


Joined: 21-December-2005
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote rightmind Quote  Post ReplyReply Direct Link To This Post Posted: 21-December-2005 at 4:18pm

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:

'select products that are flagged as featured items for the homepage
mySQL="SELECT sku,idProduct, description, serviceSpec, details, price, smallImageUrl FROM products WHERE showInHome=-1 AND active=-1"

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":

'select products that are featured items from a specific category
'be sure to replace X with your category number
mySQL="SELECT products.sku, products.idProduct, products.description, products.serviceSpec, products.details, products.price, products.smallImageUrl
FROM products INNER JOIN categories_products ON products.idProduct = categories_products.idProduct
WHERE categories_products.idCategory=X AND products.active=-1"

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!

Back to Top
Nothing View Drop Down
Newbie
Newbie
Avatar

Joined: 02-November-2005
Location: Canada
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nothing Quote  Post ReplyReply Direct Link To This Post Posted: 10-February-2006 at 6:03pm

hi rightmind
thanks so much for your idea and code. i've been afk for awhile.
i got about as far as the 'INNER JOIN' statement and ran into knowledge issues.

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).
Under TOOLS, i have 7 sub categories. All our products under tools are locted in the 7 sub sections only. Using your code, i'm able to list 'featured products' in one of the sub sections, but not in the main root catagory.

i'll continue to bang my head on this sql statement.

thanks for your help
nothing

 



Edited by Nothing - 11-February-2006 at 8:30pm
Back to Top
rightmind View Drop Down
Newbie
Newbie


Joined: 21-December-2005
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote rightmind Quote  Post ReplyReply Direct Link To This Post Posted: 12-February-2006 at 11:54am
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:

categories_products.idCategory=X OR categories_products.idCategory=Y OR categories_products.idCategory=Z

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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.