Print Page | Close Window

managing categories and brands

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=705
Printed Date: 02-December-2024 at 7:00pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: managing categories and brands
Posted By: fischerj
Subject: managing categories and brands
Date Posted: 16-March-2007 at 2:24am
I want to be able to setup my site so, when a user clicks on a category they will be directed to a page that has icons of all the brands within that category. I looked through the control panel and knowledge base and couldn't find anything.  Any help would be great!

Justin



Replies:
Posted By: netprofits
Date Posted: 16-March-2007 at 9:13pm
You would need to customize viewcategories.asp. Brands are tied to products, not categories, so you would need to write a SQL query that would retrieve a distinct list of brands from the products in the selected category. You could look in the viewBrands.asp to see the code to load and display the brand icons.

-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: fischerj
Date Posted: 17-March-2007 at 1:38am
Thanks for the reply!  That sounds like some serious editing.  Any ideas of resources on doing these kinds of database queries?

Thanks for the help!


Posted By: netprofits
Date Posted: 17-March-2007 at 8:45am

Are you pretty comfortable with ASP and SQL?
If so, then try sites like http://msdn2.microsoft.com/en-us/library/bb264565.aspx - http://msdn2.microsoft.com/en-us/library/bb264565.aspx .
If not, try http://www.w3schools.com/default.asp - http://www.w3schools.com/default.asp  for tutorials on many subjects related to web design included ASP and SQL. If you do a search on "writing SQL queries" you'll find a bunch of sites.

Anyway, the basics of what you'll need to do are as follows. (Please note, this should be one long string but I split it into different lines for readability):


SELECT idBrand,BrandName,BrandLogo
FROM Brands
WHERE idBrand IN (SELECT DISTINCT IDBrand FROM products INNER JOIN categories_products ON products.idProduct = categories_products.idProduct WHERE (categories_products.idCategory = idCategory) AND (products.active = - 1) AND (products.configOnly = 0) AND (products.removed = 0))
ORDER BY BrandName ASC;

The "WHERE idBrand IN (...)" statement basically gets a unique list of the Brand IDs for the products in a specific category. You will need to change the section that says:

categories_products.idCategory = idCategory

by changing "= idCategory" to the actual category you are working with in viewCategories.

Then the main query retrieves the brand info for brands with the BrandIDs for the products in the selected category.

Hope this gives you a good starting point. If you still can't figure it out, you could hire one of the Product Cart developers. (We are one but there are others.)



-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: fischerj
Date Posted: 24-March-2007 at 6:12pm

Thanks for the detailed reply! I haven't had a chance to test it out yet, but I'll let you know the result.

 

Thanks again!




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net