an ASP.NET Open Source CMS & eCommerce platform
Search:
Last Post 12/9/2010 6:21:35 AM By lukezy. 12 replies.
Page 1 of 2 (13 posts) << First < Prev 1 2 Next > Last >> 
3/30/2009 12:37:38 PM
macker999
Posts: 30
Joined: 10/11/2008
Product Display
Hi
 
I am trying to get a display like this
with the top 4 products of a category/subcategory at the top and the the rest of the products for the category\subcategory. When a user clicks on a category we get the total list of products for that category.
 
I am not sure how to go about this. I have created a custom fields called TopProduct. So i would enter a value (true) for the 4 products I wanted.
 
We have the Product.GetProducts(....).
 
This is how I think it woudl work.
 
I modify the Stored Procedure that Product.GetProducts(....). uses to only select products with TopProduct custom field value.
 
Then I create a new method  Product.GetAllOtherProducts(....) where we select all productds for that category that are not flagged as a top product .
 
I would then add a new datalist to CategoryProductList.ascx and bind Product.GetAllOtherProducts(....) to it.
 
Is this the best way to do this or are there better ways of doing this?
 
Thanks
3/31/2009 11:55:08 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Display
When you edit product you have an option to set it as the featured product to category. I think you can use that flag as your top products. That way you don't have to touch DB and sprocs.
 
If you prefer the new field, then yes, you can do something like what you describe above. But I would leave GetProducts as is since it has least effect to the rest of the system. Instead I will create a method that returns top products.
DotShoppingCart Staff
4/1/2009 9:13:04 AM
macker999
Posts: 30
Joined: 10/11/2008
Re: Product Display
Thanks Lukezy
 
Yes for our home page I will be using the featured product list option to display the top 4 featured products. But what I am looking to implement is a top 4 product list related to a categeory or subcategory independent of the top 4  (overall) featured products that I would use on my home page.
 
Can you direct me in the proper direction to handle this?
 
 
4/1/2009 9:25:03 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Display
There is another field sort order which you can use to control display order. The smaller the number of sort order the higher place it shows. So you can use the 4 smallest numbers for the top 4 featured products on the home page and use other numbers greater than these numbers for featured products of other categories.
DotShoppingCart Staff
4/1/2009 9:32:10 AM
macker999
Posts: 30
Joined: 10/11/2008
Re: Product Display
Would this be difficult to manage and track as we may have 20 categories and 50 subcategories and for each of these cartegories and subcategories we would be assgining a top 4 product lisitng.
4/1/2009 9:35:52 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Display
I guess it's your call. I would use 1 to 10 for top level featured products. 10 to 100 for the second level and 100 to 1000 for third level etc. You don't need to keep the sort order numbers unique. It's just the priority indicator. 
DotShoppingCart Staff
4/2/2009 12:03:12 PM
macker999
Posts: 30
Joined: 10/11/2008
Re: Product Display
Thanks Lukezy
 
Do I set the sort order under the miscellaneous tab or under the categories tab where editing a product?
 
I need to implement this multiiple level product display on the categories/subcategories pages so I am working  on the  CategoryProductList.ascx usercontrol. This is the code that puls in the product listing for the categories.
 
List<Product> products = Product.GetProducts(CategoryPath, ProductsPerPage, (PageNumber - 1) * ProductsPerPage, SortBy, Manufacturer, PriceFrom, PriceTo,StoreConfigurationSection.GetSection().ShowStock, out totalNumber);
 
I am not sure if how I could select products that have a sort order between 1 to 10 etc using this method.
 
 
 
4/3/2009 1:12:10 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Display
There are two GetProducts methods. The one that you mentioned above returns products order by featured products. Let's say if you want to show top 4 products in each category. You can set sort order 1 to 10 to these 4 products. And then pass ProductsPerPage as 4 and PageNumber as 1 to the method. It will returns these 4 top products since these 4 top products have smallest sort order.
 
The other one has an addtional parameter ProductSortBy which gives you more control on the order you wish it to return.
DotShoppingCart Staff
4/3/2009 1:17:54 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Display
Missed your another question. You use the sort order under categories tab. The one under categories tab means this product is the featured product as to this category. The sort order under miscellaneous tab is the product sort order. Here is the logic. When someone click to show this category. The top featured category products are shown first. And then other products are shown order by the product sort order. Basically you have two levels of controlling the display order.
 
DotShoppingCart Staff
4/6/2009 1:57:38 PM
macker999
Posts: 30
Joined: 10/11/2008
Re: Product Display
Thanks Lukezy
 
I am still unsure of a few things.
 
1:
For my home page I want to display a featured top 4. I have added a product list and set the product type so Featured Products. So for this the lowest sort ordered products (0 -10)  wil be displayed first.
 
I would like to display another product list on the home page with the next level of featured products. How can I display the next 20 featured products?
Should i use another product list or do I have to add custom product list to the database. If so I am unsure how to select the next 20 featured products.
 
Product.GetProducts(type, ProductItemsPerPage, (pageNumber - 1) * ProductItemsPerPage, sortby, manufacturer, priceFrom, priceTo,
                StoreConfigurationSection.GetSection().ShowStock, out totalNumber);
 
2:
I got the featured category products (top 4) displayed using the sort field under the categories. I will be displaying these products like this http://www.komplett.ie/k/kd.aspx?bn=10723.
I am using this code for the above.
 
List<Product> products = Product.GetProducts(CategoryPath, 4,1, ProductSortBy.FeaturedItem, Manufacturer, PriceFrom, PriceTo, StoreConfigurationSection.GetSection().ShowStock, out totalNumber);
 
This displays the top 4 featured products. 
 
What I want to do next is display the rest of the category products that are not the top 4 featured (using a different layout ) below the the top 4 listing like the reference web site above. Do i have to add another DataList to CategoryProductList.ascx for this and how do I select these?
 
Thanks for all your help Lukezy 
 
 
 
4/7/2009 4:26:55 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product Display
You can set startIndex (below) to 4.
 
Product.GetProducts(type, ProductItemsPerPage, startIndex, sortby, manufacturer, priceFrom, priceTo,
                StoreConfigurationSection.GetSection().ShowStock, out totalNumber);

 
DotShoppingCart Staff
Page 1 of 2 (13 posts) << First < Prev 1 2 Next > Last >>