Commerce Server Catalog - Loading a virtual catalog

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server Catalog > June 2005 > Loading a virtual catalog





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]

Author Loading a virtual catalog
PaulaBlohm

2005-06-14, 5:55 pm

I have a pretty simple question. I have a Commerce Server 2002 site that
needs to support either a base catalog or a virtual catalog. The virtual
catalog contains two base catalogs.

This site is written in .asp.

Depending on how the user logs in they will either get the base catalog or
the virtual catalog. I have the following line of code in the
global_main_lib.asp file:

If basic then
Set Application("MSCSCatalog") = MSCSCatalogManager.GetCatalog
("EmployeeVirtual")
else
Set Application("MSCSCatalog") = MSCSCatalogManager.GetCatalog
("basecatalog")
end if

The following line of code works with I use the basecatalog, but does not
work when I use the virtual catalog. (strCategoryName is passed in via a
querystring, in the example strCategoryName is set to BriefCases regardless
of which catalog is loaded).
set rsCategoryProperties = Application("MSCSCatalog").GetCategory
(strCategoryName).GetCategoryProperties

When I am using the virutal catalog, I get the following error:
Object required: 'Application(...).GetCategory(...)'

I need to know how to use the virual catalog in my project? Do I have to
handle this differently in my code? If so, can you advise me on how to do
this without having to re-code all my areas where I refer to the categories
and products? This virtual catalog has two base catalogs. Do I have to
reference them differently in the virtual catalog?

I have been looking everywhere for an example on actually using a virtual
catalog. I would appreciate any help you could provide.

Thanks,

Paula Blohm



Zoe Hart [MVP]

2005-06-17, 5:51 pm

We use virtual catalogs on one of our sites. Category names are slightly
different in a virtual catalog in that they include a reference back to the
base catalog in which the category ultimate resides. So a category CategoryX
in base catalog CatalogA, would use category name CategoryX(CatalogA) in a
virtual catalog. In our site, the whole site operates on the virtual catalog
and the category names we pass on the query string come from the virtual
catalog so it all plays well together. For example, on our department page
we'll retrieve all the child categories for that deparment and the data we
get back will have names like CategoryX(CatalogA) and CategoryY(CatalogB).
We pass that data on the query string to the next page and queries there and
downstream work OK. So the question becomes how is your category name
getting on the query string and does the page that's putting it on know what
catalog that category comes from. If you pass both pieces of information,
you'd be able to construct the virtual catalog category name if you needed
to.

--
Zoe Hart
Commerce Server MVP

"PaulaBlohm" <PaulaBlohm@discussions.microsoft.com> wrote in message
news:E7B3F42B-1A57-4CBF-B008-58487234C923@microsoft.com...
>I have a pretty simple question. I have a Commerce Server 2002 site that
> needs to support either a base catalog or a virtual catalog. The virtual
> catalog contains two base catalogs.
>
> This site is written in .asp.
>
> Depending on how the user logs in they will either get the base catalog or
> the virtual catalog. I have the following line of code in the
> global_main_lib.asp file:
>
> If basic then
> Set Application("MSCSCatalog") = MSCSCatalogManager.GetCatalog
> ("EmployeeVirtual")
> else
> Set Application("MSCSCatalog") = MSCSCatalogManager.GetCatalog
> ("basecatalog")
> end if
>
> The following line of code works with I use the basecatalog, but does not
> work when I use the virtual catalog. (strCategoryName is passed in via a
> querystring, in the example strCategoryName is set to BriefCases
> regardless
> of which catalog is loaded).
> set rsCategoryProperties = Application("MSCSCatalog").GetCategory
> (strCategoryName).GetCategoryProperties
>
> When I am using the virutal catalog, I get the following error:
> Object required: 'Application(...).GetCategory(...)'
>
> I need to know how to use the virual catalog in my project? Do I have to
> handle this differently in my code? If so, can you advise me on how to do
> this without having to re-code all my areas where I refer to the
> categories
> and products? This virtual catalog has two base catalogs. Do I have to
> reference them differently in the virtual catalog?
>
> I have been looking everywhere for an example on actually using a virtual
> catalog. I would appreciate any help you could provide.
>
> Thanks,
>
> Paula Blohm
>
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com