How do I get products of a sub category from Virtual Catalogs
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Commerce Server > Commerce Server Catalog > How do I get products of a sub category from Virtual Catalogs




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How do I get products of a sub category from Virtual Catalogs  
TechMate


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-06-04 10:51 PM

I have two base catalogs C1 and C2. Each of them have Animals Parent categor
y
and Birds, Fish ... Subcategories within the Animals category. I created a
virtual Catalog and included both C1 and C2 catalogs (without
inclusion/exclusion rules). When I try to get the products for Animals I get
the entire set of records but when I try to get products from one of the sub
categories, I dont get any records. How do i get to work with the virtual
catalog in this case.

any help will be of great help to me as I am new to Commerce Server and i
read books and tried all blogs and discussion groups





[ Post a follow-up to this message ]



    RE: How do I get products of a sub category from Virtual Catalogs  
Vinayak Tadas[MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-07-04 07:55 AM

Can you post your code snippet?

--------------------
Thread-Topic: How do I get products of a sub category from Virtual Catalogs
thread-index: AcSr7pRwlOkYnEWyRn2u3rBjyRwEZA==
X-WBNR-Posting-Host: 68.21.210.2
From: "examnotes" <TechMate@discussions.microsoft.com>
Subject: How do I get products of a sub category from Virtual Catalogs
Date: Wed, 6 Oct 2004 14:51:05 -0700
Lines: 10
Message-ID: <4DC2D473-A949-421B-BEE0-DD1B5CB15F55@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.catalog
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.catalog:5011
X-Tomcat-NG: microsoft.public.commerceserver.catalog

I have two base catalogs C1 and C2. Each of them have Animals Parent
category
and Birds, Fish ... Subcategories within the Animals category. I created a
virtual Catalog and included both C1 and C2 catalogs (without
inclusion/exclusion rules). When I try to get the products for Animals I
get
the entire set of records but when I try to get products from one of the
sub
categories, I dont get any records. How do i get to work with the virtual
catalog in this case.

any help will be of great help to me as I am new to Commerce Server and i
read books and tried all blogs and discussion groups


Thanks
Vinayak Tadas
Microsoft
http://blogs.msdn.com/vinayakt

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Get Secure!  For more info visit http://www.microsoft.com/security.  Please
reply to the newsgroups only.  Thanks






[ Post a follow-up to this message ]



    RE: How do I get products of a sub category from Virtual Catalogs  
TechMate


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-07-04 12:47 PM

Protected _catalog As ProductCatalog
_catalog = CommerceContext.Current.CatalogSystem.GetCatalog("All Virtual")
Dim ds As DataSet = _catalog.GetRootCategories()
Dim dv As New DataView(ds.Tables(0))
dv.RowFilter = "OrigCategoryName='" &
Request.QueryString("displayName") & "'"

Dim ds1 As DataSet
Dim totDS As New DataSet()
Dim im As Int16
If dv.Count > 0 Then
For im = 0 To dv.Count - 1
Dim myCat As ProductCatalog =
CommerceContext.Current.CatalogSystem.GetCatalog(dv.Item(im)("BaseCatalogNam
e").ToString)
Try
ds1 =
myCat.GetCategory(dv.Item(im)(2).ToString).GetProducts(Nothing, True)
totDS.Merge(ds1, True)
Catch ex As Catalog.CategoryNotFoundException

End Try
Next
End If
designsDataSet = totDS
----------------------------------------------------------------------------
------------------
This code works and I can get all the products for Parent Categories (Like
Animals) but not for Birds which is sub category witin one of the CATALOGS o
f
the Virtual Catalog.

Will this help you find me solution??
Thanks
TechMate


""Vinayak Tadas[MSFT]"" wrote:

> Can you post your code snippet?
>
> --------------------
> Thread-Topic: How do I get products of a sub category from Virtual Catalog
s
> thread-index: AcSr7pRwlOkYnEWyRn2u3rBjyRwEZA==
> X-WBNR-Posting-Host: 68.21.210.2
> From: "examnotes" <TechMate@discussions.microsoft.com>
> Subject: How do I get products of a sub category from Virtual Catalogs
> Date: Wed, 6 Oct 2004 14:51:05 -0700
> Lines: 10
> Message-ID: <4DC2D473-A949-421B-BEE0-DD1B5CB15F55@microsoft.com>
> MIME-Version: 1.0
> Content-Type: text/plain;
> 	charset="Utf-8"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Content-Class: urn:content-classes:message
> Importance: normal
> Priority: normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> Newsgroups: microsoft.public.commerceserver.catalog
> NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
> Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.catalog:5011
> X-Tomcat-NG: microsoft.public.commerceserver.catalog
>
> I have two base catalogs C1 and C2. Each of them have Animals Parent
> category
> and Birds, Fish ... Subcategories within the Animals category. I created a
> virtual Catalog and included both C1 and C2 catalogs (without
> inclusion/exclusion rules). When I try to get the products for Animals I
> get
> the entire set of records but when I try to get products from one of the
> sub
> categories, I dont get any records. How do i get to work with the virtual
> catalog in this case.
>
> any help will be of great help to me as I am new to Commerce Server and i
> read books and tried all blogs and discussion groups
>
>
> Thanks
> Vinayak Tadas
> Microsoft
> http://blogs.msdn.com/vinayakt
>
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> You assume all risk for your use. © 2002 Microsoft Corporation. All right
s
> reserved.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> Get Secure!  For more info visit http://www.microsoft.com/security.  Pleas
e
> reply to the newsgroups only





[ Post a follow-up to this message ]



    RE: How do I get products of a sub category from Virtual Catalogs  
TechMate


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-10-04 10:50 PM

Hey Vinayak,

Can you help me find the solution???

"TechMate" wrote:
[vbcol=seagreen]
>  Protected _catalog As ProductCatalog
> _catalog = CommerceContext.Current.CatalogSystem.GetCatalog("All Virtual")
>  Dim ds As DataSet = _catalog.GetRootCategories()
> Dim dv As New DataView(ds.Tables(0))
>         dv.RowFilter = "OrigCategoryName='" &
> Request.QueryString("displayName") & "'"
>
>         Dim ds1 As DataSet
>         Dim totDS As New DataSet()
>         Dim im As Int16
>         If dv.Count > 0 Then
>             For im = 0 To dv.Count - 1
>                 Dim myCat As ProductCatalog =
> CommerceContext.Current.CatalogSystem.GetCatalog(dv.Item(im)("BaseCatalogN
ame").ToString)
>                 Try
>                     ds1 =
> myCat.GetCategory(dv.Item(im)(2).ToString).GetProducts(Nothing, True)
>                     totDS.Merge(ds1, True)
>                 Catch ex As Catalog.CategoryNotFoundException
>
>                 End Try
>             Next
>  End If
>         designsDataSet = totDS
> --------------------------------------------------------------------------
--------------------
> This code works and I can get all the products for Parent Categories (Like
> Animals) but not for Birds which is sub category witin one of the CATALOGS
 of
> the Virtual Catalog.
>
> Will this help you find me solution??
> Thanks
> TechMate
>
>
> ""Vinayak Tadas[MSFT]"" wrote:
> 





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:17 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register