| Author |
Category.GetProducts sort order
|
|
|
| I am trying to do something that I would think is simple. For some
reason I am not seeing the sort order change at all when I run the
following code. Can someone point me in the correct direction?
Thanks.
Dim products As DataSet
Dim category As category
Dim categories As String()
Dim canonicalPath As String()
Dim productCatalog As productCatalog
Dim cacheKey As String
' Now set up a search options object.
Dim csOptions As CatalogSearchOptions = New
CatalogSearchOptions
' Retrieve Product Catalog object
productCatalog =
CommerceContext.Current.CatalogSystem.GetCatalog(Me.Catalog)
' For now sort on SKU ascending
csOptions.SortProperty = "[SKU]"
csOptions.SortAscending = True
' Set the options into the search object.
'Retrieve Category object
category = productCatalog.GetCategory(Me.Category)
' Retrive child products for category
products = category.GetProducts(csOptions)
| |
| Sudha Raghavan [MSFT] 2005-03-23, 6:01 pm |
| Are you using Commerce Server 2000 or Commerce Server 2002?
Also is the PropertyName of the property you are trying to sort on "[SKU]"?
Please note that the square brackets [ ] must be part of the name too.
Thanks
Sudha
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
--------------------
From: "Randy" <randy@luministic.com>
Newsgroups: microsoft.public.commerceserver.catalog
Subject: Category.GetProducts sort order
Date: 23 Mar 2005 07:28:12 -0800
Organization: http://groups.google.com
Lines: 29
Message-ID: <1111591692.778898.181550@g14g2000cwa.googlegroups.com>
NNTP-Posting-Host: 66.129.101.227
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1111591697 16043 127.0.0.1 (23 Mar 2005
15:28:17 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 23 Mar 2005 15:28:17 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: g14g2000cwa.googlegroups.com; posting-host=66.129.101.227;
posting- account=kLbIlQ0AAACMzDze7AByfiLuTkVm3WlF
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fa
stwebnet.it!tiscali!newsfeed1.ip.tiscali.net!news.glorb.com!postnews.google.
com!g14g2000cwa.googlegroups.com!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.commerceserver.catalog:5328
X-Tomcat-NG: microsoft.public.commerceserver.catalog
I am trying to do something that I would think is simple. For some
reason I am not seeing the sort order change at all when I run the
following code. Can someone point me in the correct direction?
Thanks.
Dim products As DataSet
Dim category As category
Dim categories As String()
Dim canonicalPath As String()
Dim productCatalog As productCatalog
Dim cacheKey As String
' Now set up a search options object.
Dim csOptions As CatalogSearchOptions = New
CatalogSearchOptions
' Retrieve Product Catalog object
productCatalog =
CommerceContext.Current.CatalogSystem.GetCatalog(Me.Catalog)
' For now sort on SKU ascending
csOptions.SortProperty = "[SKU]"
csOptions.SortAscending = True
' Set the options into the search object.
'Retrieve Category object
category = productCatalog.GetCategory(Me.Category)
' Retrive child products for category
products = category.GetProducts(csOptions)
| |
|
| I am using Commerce Server 2002. SKU is the property name not [SKU].
I am not getting an error thrown when I use [SKU].
| |
|
| I've been thinking about my last response and I am not sure SKU is a
property. It is a field in the database. How would I determine if it
is an available property? Knowledge base article or something that
walks you through this?
Thanks for the help!
| |
| Sudha Raghavan [MSFT] 2005-03-24, 8:47 pm |
| Please check the CatalogAttributes table. Check if there is a row with
PropertyName "SKU".
Or you could use the CatalogContext.GetProperty("SKU") to try and get the
proeprty. If one exist you would get a CatalogProperty object back else an
EntityDoesNotExistException.
Thanks
Sudha
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
--------------------
From: "Randy" <randy@luministic.com>
Newsgroups: microsoft.public.commerceserver.catalog
Subject: Re: Category.GetProducts sort order
Date: 24 Mar 2005 04:04:55 -0800
Organization: http://groups.google.com
Lines: 7
Message-ID: <1111665895.203908.94330@l41g2000cwc.googlegroups.com>
References: <1111591692.778898.181550@g14g2000cwa.googlegroups.com>
<EbmdDM$LFHA.2996@TK2MSFTNGXA03.phx.gbl>
<1111630727.833603.250280@f14g2000cwb.googlegroups.com>
NNTP-Posting-Host: 66.129.101.227
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1111665899 13801 127.0.0.1 (24 Mar 2005
12:04:59 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 24 Mar 2005 12:04:59 +0000 (UTC)
In-Reply-To: <1111630727.833603.250280@f14g2000cwb.googlegroups.com>
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: l41g2000cwc.googlegroups.com; posting-host=66.129.101.227;
posting- account=kLbIlQ0AAACMzDze7AByfiLuTkVm3WlF
Path:
TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
ews.com!news.glorb.com!postnews.google.com!l41g2000cwc.googlegroups.com!not-
for-mail
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.commerceserver.catalog:5321
X-Tomcat-NG: microsoft.public.commerceserver.catalog
I've been thinking about my last response and I am not sure SKU is a
property. It is a field in the database. How would I determine if it
is an available property? Knowledge base article or something that
walks you through this?
Thanks for the help!
| |
|
| I checked the CatalogAttributes table and there is a SKU field. If I
go into Bizdesk and associate this property with the base product I can
see the field until I add variants to the product. Then the SKU is
associated with the various product variant combinations. I am not
really sure where to look or what else to try at this point.
Thanks again for all the help!
| |
| Sudha Raghavan [MSFT] 2005-03-28, 2:47 am |
| I am not clear on the end result. Could you let me know the following::
1. Are you trying to sort "Products" or "Varaints of a product" with the
propertyName SKU.
2. Have you added "SKU" as a NormalProperty or VariantProperty to the
Product Definition.
Thanks
Sudha
--------------------
From: "Randy" <randy@luministic.com>
Newsgroups: microsoft.public.commerceserver.catalog
Subject: Re: Category.GetProducts sort order
Date: 26 Mar 2005 06:39:56 -0800
Organization: http://groups.google.com
Lines: 8
Message-ID: <1111847996.157869.304750@o13g2000cwo.googlegroups.com>
References: <1111591692.778898.181550@g14g2000cwa.googlegroups.com>
<1111665895.203908.94330@l41g2000cwc.googlegroups.com>
<NqcybxNMFHA.1016@TK2MSFTNGXA03.phx.gbl>
NNTP-Posting-Host: 66.129.101.227
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1111848000 7398 127.0.0.1 (26 Mar 2005 14:40:00
GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 26 Mar 2005 14:40:00 +0000 (UTC)
In-Reply-To: <NqcybxNMFHA.1016@TK2MSFTNGXA03.phx.gbl>
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: o13g2000cwo.googlegroups.com; posting-host=66.129.101.227;
posting- account=kLbIlQ0AAACMzDze7AByfiLuTkVm3WlF
Path:
TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews.google.com!o1
3g2000cwo.googlegroups.com!not-for-mail
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.commerceserver.catalog:5329
X-Tomcat-NG: microsoft.public.commerceserver.catalog
I checked the CatalogAttributes table and there is a SKU field. If I
go into Bizdesk and associate this property with the base product I can
see the field until I add variants to the product. Then the SKU is
associated with the various product variant combinations. I am not
really sure where to look or what else to try at this point.
Thanks again for all the help!
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
| |
|
| 1. Question: Are you trying to sort "Products" or "Varaints of a
product" with the
propertyName SKU.
ANSWER: I would like to be able to sort the "Products" on the
propertyName SKU. If the Item has variants it then has an SKU
associated with each combination, but the base item property still has
a SKU.
2. Question: Have you added "SKU" as a NormalProperty or
VariantProperty to the
Product Definition.
ANSWER: I have added it the product normal properties. When I add
the variants to the product family definition the variants each get a
SKU.
| |
|
| Does anyone have a code snipet or a site that they could forward to me
to show me how to sort on a product property using the
category.GetProducts() method with search options?
THANKS in advance for your time and help!
| |
| Vinayak Tadas[MSFT] 2005-04-07, 6:03 pm |
| See this link
This should help you
http://blogs.msdn.com/vinayakt/arch.../13/130972.aspx
Specify the correct classtype.
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/secur_ity.
Please
reply to the newsgroups only. Thanks
--------------------
From: "Randy" <randy@luministic.com>
Newsgroups: microsoft.public.commerceserver.catalog
Subject: Re: Category.GetProducts sort order
Date: 30 Mar 2005 03:57:35 -0800
Organization: http://groups.google.com
Lines: 7
Message-ID: <1112183855.264373.49870@z14g2000cwz.googlegroups.com>
References: <1111591692.778898.181550@g14g2000cwa.googlegroups.com>
<1111847996.157869.304750@o13g2000cwo.googlegroups.com>
<SZV8Wc0MFHA.3984@TK2MSFTNGXA03.phx.gbl>
<1112059213.375845.294800@g14g2000cwa.googlegroups.com>
NNTP-Posting-Host: 66.129.101.227
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1112183859 9552 127.0.0.1 (30 Mar 2005 11:57:39
GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 30 Mar 2005 11:57:39 +0000 (UTC)
In-Reply-To: <1112059213.375845.294800@g14g2000cwa.googlegroups.com>
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: z14g2000cwz.googlegroups.com; posting-host=66.129.101.227;
posting- account=kLbIlQ0AAACMzDze7AByfiLuTkVm3WlF
Path:
TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news.glorb.com!postnews.google.com!z14g2000cwz.googlegroups.com!not-fo
r-mail
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.commerceserver.catalog:5345
X-Tomcat-NG: microsoft.public.commerceserver.catalog
Does anyone have a code snipet or a site that they could forward to me
to show me how to sort on a product property using the
category.GetProducts() method with search options?
THANKS in advance for your time and help!
|
|
|
|