|
Home > Archive > Commerce Server General > August 2005 > Display on Site
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Ryan Ross 2004-02-07, 9:36 am |
| Question (Retail 2002): Display on Site. Is there a method and property
associated with the Product Object? Or does it just set a 1 or 0 in a table,
and you have to create the procedure?
Thanks,
Ryan
| |
| newsgroup user 2004-02-07, 9:36 am |
| It's a little painful to get that info, but here's the way to do it using the Commerce Server objects. Use the Product.GetProductProperties to get iterate through all of the properies (which I'm sure you know already) and then look up each property's def
inition using the CatalogContext.GetDefinitionProperties method (where the CatalogContext object is available from CommerceContext.Current.CatalogSystem). That method returns a DataSet of all the "property's properties", if you know what I mean. That sh
ould give you access to the DisplayOnSite property, along with any other's that you might like to use, or add there). Hope that helps!
- Scott
----- Ryan Ross wrote: -----
Question (Retail 2002): Display on Site. Is there a method and property
associated with the Product Object? Or does it just set a 1 or 0 in a table,
and you have to create the procedure?
Thanks,
Ryan
| |
| Ryan Ross 2004-02-07, 9:36 am |
| Ouch. Aright, away we go.
Thanks,
Ryan
"ScottE" <scotte@magenic.com.ihatespam> wrote in message
news:7CB614A6-AFB3-4179-BF09-E128E19C3061@microsoft.com...
> It's a little painful to get that info, but here's the way to do it using
the Commerce Server objects. Use the Product.GetProductProperties to get
iterate through all of the properies (which I'm sure you know already) and
then look up each property's definition using the
CatalogContext.GetDefinitionProperties method (where the CatalogContext
object is available from CommerceContext.Current.CatalogSystem). That
method returns a DataSet of all the "property's properties", if you know
what I mean. That should give you access to the DisplayOnSite property,
along with any other's that you might like to use, or add there). Hope that
helps!
>
> - Scott
>
> ----- Ryan Ross wrote: -----
>
> Question (Retail 2002): Display on Site. Is there a method and
property
> associated with the Product Object? Or does it just set a 1 or 0 in a
table,
> and you have to create the procedure?
>
> Thanks,
> Ryan
>
>
>
| |
| jtoth5 2005-08-08, 11:30 am |
| That was close what he posted but not entirely correct...
You will want to use the CatalogContext.GetDefinitionProperties method, for sure, but only to get the valid properties for that device (it does not give you the DisplayOnSite attribute.)
Next you need to traverse through the Product.GetProductProperties columns (each is a property.) If the property is contained within the valid properties that you got above (w/GetDefinitionProperties), get the attributes of that property, using CatalogContext.GetPropertyAttributes.
Row 0, column 21, in the dataset returned by GetPropertyAttributes will contain the DisplayOnSite attribute for that property.
It is an ugly way to do it, but it seems the only way that i know of... |
|
|
|
|