Tuesday, September 13, 2011

New Site Launched!

DevWerx is pleased to announce the new Canadian Jockey store based upon the Commerce Server 2009 and CSMetal. A great mix of technologies came together on this project to make it a success!


Check out the site at Jockey.ca

Friday, May 13, 2011

Commerce Server Performance Tips

Any great site using the best technologies is slow if you don't plan it carefully. Several clients have had us doing an Architectural Review of their site based upon performance issues. Microsoft has a performance guide here evaluating tests run against the OOB Extensibility Kit. Most Commerce Server based sites are radically customized from the Extensibility Kit as discussed in my prior post.

The main area we've seen having issues are the Basket operations. The Ext Kit has some caching around the query which is helpful, yet easily missed. The basket also gets into a state that requires both the basket and total pipeline components to be called for every basket query or manipulation. This often coupled with invalid caching of shipping, tax and credit card services along with fees per transaction that are often incurred are problematic.

Therefore, three quick wins:

1) Cache all information that the Mini Cart needs so that it doesn't ever need to call the Basket Query operation.
2) Override the PipelineProcessor sequence component and add better logic as to when the total pipeline should be called.
3) Cache the calls to expensive (time and per transaction) services by storing values in weakly typed properties of the orderform or shipment which will enable you to skip unnecessary calculations. If you store the information in the shipments, you'll need to write your own shipping splitter.

Friday, March 11, 2011

Commerce Server 2009 Options and Considerations

The original release of Commerce Server 2009 was tightly integrated with Sharepoint 2007 as many companies had been requesting this type of integration. This was a big shift from pure ASP.NET development leveraging the StarterSite in Commerce Server 2007. Sharepoint was hot, companies wanted rich Content Management and this provided good options for some clients. Microsoft provided an extensibility kit to allow developers to modify the default Sharepoint site and integration with the new Multi-Channel Commerce Foundation. Sharepoint 2010 has since been released and a new version of the extensibility kit became available. The extensibility kit is a solid kit to build on with a solid performance guide that demonstrates the readiness for production that the kit is capable of.

In my experience in Sharepoint 2007, 2010 and pure ASP.NET Commerce based implementations, there are many good options above. Interestingly enough, many clients still want more control and flexibility that they cannot easily achieve with Sharepoint. What are they to do? Some of their considerations are also due to the internal staff they have to develop and extend the solution.

Implementation's I've been involved in recently:

- Pure ASP.NET forms based implementations using the Multi-Channel Commerce foundation. Leverage of the extensibility kit Common project and UI presenters. Some use other third parties for Content Management while some sites have the developers make the infrequent site content changes. Many of the content changes are dynamic in nature based upon the Commerce Catalog and Marketing data.

- Sharepoint 2010 global multilingual implementations with extensive site, webpart, catalog modifications where Extensibility Kit was used only as a reference. Two tier and Three tier implentations using the Mulit-Channel Commerce foundation.

There are so many variables in each of these types of implementations. UX layer, mobile support, Content Management, Search Provider, Product Review Provider, Tax providers, Payment providers, Shipment providers, ERP integration. Each implementation is truly custom with Commerce Server being the strong foundation that makes it all possible.

We've been recently excited about a new quieter release from the Commerce Server product team, CSMetal which contains alot of great ideas that eager developers can build great sites upon. Use MVC 3 for the Web layer, generated Commerce contracts from configuration files. It isn't as rich in testing as the existing extensibility kit, yet most client's final implementation is fully customized anyway.

We are working hard on a site to be launched in May that is based upon CSMetal!

Therefore, you can see that there are many options to consider when developing a Commerce Server based solution. Even more options to be considered as you look at N-Tier solutions and Commerce Server 2009 R2.

Friday, May 21, 2010

LineItem Deletion

CS 09 has an issue w/ LineItem deletions on a Basket. The issue is with the underlying CS 2007 API in that the LineItems.Remove method is overloaded to take either the index or the lineitem. The sequence components use the Remove method with the lineitem which is causing the first one in the collection to be removed. The cleanest approach in solving the problem is to override the Sequence Component. It is simply one method that needs to be overridden. Here is the solution:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Commerce.Contracts.Messages;
using Microsoft.Commerce.Contracts;
using Microsoft.Commerce.Providers.Utility;
using DevWerx.Web.Commerce.Common;
using Microsoft.Commerce.Providers.Components;
 
namespace DevWerx.Web.Commerce.Extensions.SequenceComponents
{
  public class BasketLineItemsProcessor : Microsoft.Commerce.Providers.Components.BasketLineItemsProcessor
  {
    protected override void DeleteRelatedItem(CommerceDeleteRelatedItem deleteRelatedItemOperation)
    {
      string str = BasketRelatedItemOperationSequenceComponent.GetSearchModelId(deleteRelatedItemOperation, "LineItem", true);
      if (!string.IsNullOrEmpty(str))
      {
        Microsoft.CommerceServer.Runtime.Orders.LineItem lineItemFromCachedOrderGroup = base.GetLineItemFromCachedOrderGroup(str);
        // replacing lineitem with index
        base.CachedOrderGroup.GetDefaultOrderForm().LineItems.Remove(lineItemFromCachedOrderGroup.Index);
      }
      else
      {
        base.CachedOrderGroup.GetDefaultOrderForm().LineItems.Clear();
      }
    }
  }
}
 

Then, of course you'll need to modify your ChannelConfiguration.config file:

   <MessageHandler name="CommerceUpdateOperation_Basket" responseType="Microsoft.Commerce.Contracts.Messages.CommerceUpdateOperationResponse, Microsoft.Commerce.Contracts, Version=1.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35">
    <OperationSequence>
     <Component name="Basket Loader" type="Microsoft.Commerce.Providers.Components.BasketLoader, Microsoft.Commerce.Providers, Version=1.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35" />
     <Component name="Basket processor" type="Microsoft.Commerce.Providers.Components.BasketProcessor, Microsoft.Commerce.Providers, Version=1.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35" />
     <!--<Component name="Line Items processor" type="Microsoft.Commerce.Providers.Components.BasketLineItemsProcessor, Microsoft.Commerce.Providers, Version=1.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35"> -->
     <Component name="Line Items processor" type="DevWerx.Web.Commerce.Extensions.SequenceComponents.BasketLineItemsProcessor, DevWerx.Web.Commerce.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ed11d75c6be4ce25" >
     ...
 

Saturday, February 27, 2010

Google Checkout

A client has requested Google Checkout and Paypal integration on their Commerce Server 2009 site. I was involved in a full on integration with one of the Featured Stores during the Google Checkout launch back in 2006. The Featured Store was on Commerce Server 2002. It is one challenge to send over the current Cart, yet another to allow merchant callback calculations, new order notifications, refunds, status changes, etc... Do all of this with the amount of Commerce Server pipeline development and customization - Fun stuff. Anyway, back to the present state - Basic Cart integration leveraging the underlying Commerce Entities within new Web Parts that don't affect the current Web Parts. Clients are always bringing about some fun challenges...

Let us know if you need some custom Google Checkout and Paypal integration with Commerce Server 2009!

Friday, February 19, 2010

DevWerx, Inc. - Your Commerce Server 2009 Experts

DevWerx, Inc. - Your Commerce Server 2009 Experts

Check us out while we get ready to start providing some posts on some of our Commerce Server experiences.