Archive for March 2010

This article provides instructions to illustrate how you can localize the Product Query Web Part of the default site in SharePoint, as well as the underlying catalog data that feeds it. Many web parts in Commerce Server leverage XSL templates which transform serialized business entities adding layout and other text. For this sample, it is assumed the following software has been installed in the server (Windows Server 2008):

  • The Korean Language Interface Pack (LIP):
  • The Windows SharePoint Services Language Pack (Korean)
  • Windows SharePoint Services 3.0 Language Pack Service Pack 1 (Korean)
  • 2007 Microsoft Office Servers Service Pack 1 (Korean)

To localize the Product Query web part, we will perform the following tasks:

  1. Create a virtual catalog for prices in the new currency
  2. Add a pricing rule to the virtual catalog for the new currency
  3. Create localized site variations in Windows SharePoint Services
  4. Configure SharePoint Commerce Services to use the new virtual catalog
  5. Change the language-dependant details in web part templates

Note: Since I don’t know Korean language, some of the images are copied from Microsoft site (Japanese).

Create a virtual catalog for prices in the new currency

To create a virtual catalog, perform the following tasks:

  1. Open the Commerce Server Catalog Manager and connect to the Default Site.
  2. Under Tasks, select Create a New Virtual Catalog.
  3. Set the currency to KRW and click Next.

clip_image003

  1. In the Catalog Languages window, add Korean to the catalog languages and click Next.

clip_image005

  1. In the Virtual Catalog Summary window click Create.

clip_image006

  1. Add products to the new catalog in the wizard and click Create.

clip_image007

  1. Rebuild the new Virtual Catalog.

clip_image001[1]Add a pricing rule to the virtual catalog for the new currency

For this how-to the new pricing rule will multiply the base price by a currency exchange rate. To create a price rule, perform the following tasks:

  1. Open the Commerce Server Catalog Manager and connect to the Default Site.
  2. Click On the Rules tab, and then click the Add button.
  3. Select the catalog to apply the rule upon and click Next.
  4. In the Rule Properties window, for Rule type select Pricing, for Pricing rule type select Add Percentage, and for Price Amount type the exchange rate and click Create.

clip_image009

  1. From Catalog Manager, right click on the virtual catalog, and from the context menu select Edit Catalog Properties.
  2. Click the Rules tab; you should now see your Pricing Rule listed.

clip_image011

clip_image001[2]Create localized site variations in Windows SharePoint Services

To create a localized site variations in Windows SharePoint Services, perform the following tasks:

  1. In the default site (in this example it is the root site of the site collection), click Site Actions > Site Settings > Modify All Site Settings.

clip_image013

  1. Click on Variations and set location to root (/), and then choose to copy resources.

clip_image015

  1. In Site Settings, click Variation Labels and create a new label (create on for Korea).
  2. Click Create Hierarchies.

clip_image017

The web site structure now has English and Korean site variations, which are SharePoint sub-sites. Now that the current locale is set, please note two characteristics of the Korean site variation. First, the Korean version of the Default Site retrieves localized strings from resources files for label controls and other components of the solution, such as web part descriptions. Second, note that the current locale of a web site is included in the calls that SharePoint Commerce Services make to the Commerce Foundation API. Thus, values of localized catalog properties are retrieved.

Configuring SharePoint Commerce Services to use the new virtual catalog

In this step we configure the Korean site variation to access the previously created virtual catalog. The intent is to retrieve product prices in KRW.

To configure SharePoint Commerce Services to use the new virtual catalog, perform the following tasks:

  1. In Site Settings, click Manage Site Content and Structure.

clip_image019

  1. Expand the Korean site variation, and click on Channel Configuration.

clip_image021

  1. We now set the channel’s value to Default and the DefaultCatalog’s to AdventureVirtual.
  2. Click on the cell positioned under the Value column and on the Channel row.
  3. Choose Edit Properties.
  4. Change the content type of this list item to ChannelStringContentType. In the Value field, enter Default and then click Ok.
  5. Click on the cell positioned under the Value column and on the DefaultCatalog row.
  6. Choose Edit Properties. Change the content type of this list item to ChannelStringContentType.
  7. In the Value input field, enter AdventuresVirtual, and click OK.

We have now configured the Korean site variation to access the Default channel and the AdventuresVirtual catalog. The web parts in the Korean site variation will now reference the virtual catalog with its locale and pricing changes, whereas the English site variation references the base catalog.

clip_image001[4] Changing language-dependant details in web part templates (I haven’

Localizing a template for a web part involves of updating string constants, currency formats and other language-dependant details in its template file under the Commerce Server Templates document library in the site variation.

The next step is to change the price format in the Product Details Web Part. The price itself is already expressed in KBN in the virtual catalog by the percentage rule.

clip_image022

<<Below diagram is shown in Japanese – copied from MS site>>

Related Articles


If you like this post, please click on our sponsor advertisement.


After successfully installing commerce server site, when you try to open the website, you may encounter following error.

image

Recently, I fixed database authentication problem by applying a hot fix released by Microsoft.

http://support.microsoft.com/kb/975603

Seems somewhere I have missed the steps mentioned in the document (drop the Microsoft.CommerceServer.Runtime.dll that’s supplied in that hotfix in GAC) and after installing the hot fix, the site started working fine :) . Thought of sharing the same to fellow commerce server developers.

Related Articles


If you like this post, please click on our sponsor advertisement.


Follow me on Google+
Couldn't get data from google+
Sign up for Newsletter