Archive for April 2009
I want to show the discount applicable for a given promotion coupon code and I feel this is one of the genuine requirement. I tried to play with the API to make this work. If we check back the associations between objects, the coupon code is stored under promotion, the promotions are associated to discounts and discounts are associated to campaign.
|
Campaign |
If you check data management object structure, Promotion code and campaigns are easily created and these are associated to a discount.
To check which promotion code is assigned to a discount, I think it would be simple. First – get all list of discounts and check for desired promotion code in each discount.
The real trick comes when we want to show the discounts based on the coupon code. I didn’t tried using API but I feel to write a simple script instead of iterating hundreds of discount options. Here is the script that gives the discount name associated for a particular coupon code.
|
Select u_campitem_name (Select p.[i_pcdef_id], d.[u_pc_code] |
Note: replace “ABCD1234” with your coupon code.
If you like this post, please click on our sponsor advertisement.
After creating blank site using MicrosoftCommerceDefaultSiteNoData.pub file, when I tried to access Advertisements, I am getting following error.
|
An exception of type ‘Microsoft.Commerce.Providers.Exceptions. InvalidOperationRequestException’ occurred and was caught. ————————————————————————— 03/26/2009 10:29:36 Type : Microsoft.Commerce.Providers.Exceptions. InvalidOperationRequestException, Microsoft.Commerce.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 Message : No content selection context with the name ‘Advertising’ exists for the site ‘MyDefaultSite’. Please see the service configuration file section ServiceConfiguration/Sites/Site[@sitename='MyDefaultSite']/contentSelection for the list of configured selection context names. Source : Microsoft.Commerce.Providers Help link : Data : System.Collections.ListDictionaryInternal TargetSite : Microsoft.CommerceServer.Runtime.Targeting. ContentSelectionContext GetSelectionContext(System.String, System.String) Stack Trace : at Microsoft.Commerce.Providers.CSHelpers.ContentSelectionHelper. GetSelectionContext(String siteName, String contextName) at Microsoft.Commerce.Providers.Components.ContentSelectorLoader. ExecuteQuery(CommerceQueryOperation queryOperation, OperationCacheDictionary operationCache, CommerceQueryOperationResponse response) at Microsoft.Commerce.Providers.Components.OperationSequenceComponent. Execute(CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response) at Microsoft.Commerce.Broker.OperationSequence.ExecuteComponentTree (List`1 executionTreeList, CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response) at Microsoft.Commerce.Broker.OperationSequence.Execute (CommerceOperation operation) at Microsoft.Commerce.Broker.MessageHandler. ProcessMessage(String messageHandlerName, CommerceOperation operation) at Microsoft.Commerce.Broker.OperationService. InternalProcessRequest(CommerceRequest request) at Microsoft.Commerce.Broker.OperationService. ProcessRequest(CommerceRequest request) |
Resolution:
We will get this error because of not defining content selection in channel configuration. To fix this issue, open channelconfiguration.config file, add cache for advertising and discounts under <caches> tag and add advertising and discounts to contentselection as shown in the image below.
If you like this post, please click on our sponsor advertisement.
One of my friend was able to unpack csharp site on commerce server 2009 box but when he tries to open the site he was getting following error.
|
Log Name: Application |
One thing we should keep in mind that CSharp.pub is for CS2007 and as it is it will not work in CS2009 and this pup does not contains information for “Store Object”, “VirtualEarthConfig” & “TargetingContext”. Commerce Server 2009 has provided a separate pub similar to CSharp.pub. the pub name is “MicrosoftCommerceDefaultSiteNoData.pup” or “MicrosoftCommerceDefaultSiteWithSampleData.pup”. The only difference between these two pubs is the first pub imports only schema and the other one imports schema & data.
If you are developing a new asp.net website on top of CS2009, the new pubs will not create asp.net website for you. In that context we can use Csharp.pub file to create CSharp site only. For that open commerce server manager, right click on applications folder in newly created site and select “Add Application”
After selecting pub file, from the selected applications, select “CSharpsite” checkbox and get the asp.net site installed.
If you like this post, please click on our sponsor advertisement.
