An Approach to Implement Combos with Commerce Server 2007
When I was introduced to Commerce Server back in 2001 I initially thought that the product was a little box with a complete online store inside it. After a couple of days playing with the product and reading the documentation I figured out that I was wrong, the product was much more than a simple ready online store.
It was a complete framework and a set of tools to enable websites to the e-commerce world!
Since then, the product evolved a lot. Today we have the brand new Commerce Server 2007 version with a lot of improvements and also some “baby born” features.
Let’s deep on a subject and get out of this blah blah blah… let’s talk about discounts. The discount engine implemented with Commerce Server 2007 allows the use of catalog selection and profile based rules to apply discounts on a product set and using the context of the user navigation.
That’s great. Without much effort we can have a store selling products and applying discounts based on the profile of the customer navigating on the website. One of the great things about our customers is that are always claiming for new types of discount campaigns and our development groups simple cannot implement all possible ways to apply a discount (they need to keep their scope manageable) :).
I’m my current project I’m helping one of our partners on a store development with Commerce Server 2007 and guess what? We have a very effusive and creative customer! :) It’s only a joke, I guess I understand the customer need, they claim for differentiation to overcome their competitors and we are proud to help them using our platform and creative technical ideas.
Ok Cris. I’ve got your challenge so what’s the problem?
Commerce Server 2007 offers the following discounts types by default:
-
Sample Discount: Buy a product at a reduced price. (Example: Buy two backpacks and get 25% off the price of each)
-
Minimum Purchase Discount: Buy a minimum quantity of a product, get a reduced price. (Example: Buy at least three CDs and get $1 off the price of each)
-
Buy N, Get 1 More Free: Buy a minimum number of an item; get one more of the same item free. (Example: Buy 5 ties, get the 6th one free)
-
Paired Discount: Buy one product and get a price reduction on another product. (Example: Buy a bicycle, get a helmet at 15% off)
-
Paired Set Discount: Buy a specified quantity of a product, get a price reduction on another product. (Example: Buy 6 bottles of wine, get a wine rack at $10 off)
-
Order Discount: Buy a specified total amount; get a price reduction on the order total or on the shipping cost. (Example: Buy at least $500 worth of services, and get 20% off)
As I said, customers are very creative and real world stores need a kind of “bundles discount type”. What’s a bundle discount type? These kinds of discounts apply when the store wants that you buy the products X and Y and get the Z product as a free gift.
For example, the store wants to have the following sales campaign: Buy a XBOX 360 console together with an additional controller and get the Halo 3 for free.
How to implement this kind of discounts using Commerce Server 2007?
-
Create an additional product definition called BUNDLE and associate relevant properties to it. You can also create additional properties if needed.
-
Create a new product based on the definition created (with the bundle description, price, and other properties values). Example: Xbox 360 Super Combo.
-
Change the “Add Basket” code to include the constituent products when the combo on the basket is included. So when the buyer includes the Xbox 360 super combo (dummy product) on her basket, she will be including the console and the controller (the real constituents).
foreach (CatalogRelationshipsDataSet.CatalogRelationship relatedProduct in relatedProducts.CatalogRelationships) {
if (relatedProduct.RelationshipName == "CONSTITUENT")
{
LineItem lineItemBrinde =
new LineItem(catalogId, relatedProduct.TargetProductId, null, 1);
orderForm.LineItems.Add(lineItemBrinde, false);
}
}
-
Change the Add Basket code to always check if the product has the AWARD relationship. When including any product with this relationship also include the product pointed by the relation.
-
When the basket pipeline runs, the paired discount is applied giving 100% discount on the Halo 3 game.
With this strategy, the Commerce Server 2007 inventory system will get the bundle constituents as individual line items. Therefore, during the add basket phase the inventory positions will be checked against the stock numbers and during the checkout process the individual constituents will be updated with new inventory values.
This posting is provided "AS IS" with no warranties, and confers no rights.