Episerver Commerce

Episerver commerce is an Episerver add-on that helps you create, manage, measure and maintain an online store.  In these lessons, you will learn the basics of using Episerver commerce. By the end, you will understand installation, general store settings, adding and editing products, order management.

CONTENTS

1. How to install Episerver Commerce 7 on MVC Site in less than 10 Minutes!
2. How To Load And Retrieve A Variant or Product From Episerver Commerce
2. The Different Ways Of Getting Items From The Catalog in Episerver Commerce
3. How do I get the current Product or Variant from a controller or attribute ?
4. The Different Ways Of Saving Content In Episerver Commerce
5. How To Hook Into Episerver Commerces 8 Catalog Event Handlers
6. Episerver Commerce The Purchase Order Object Explained
7. How To Unit Test Episerver Commerce

Latest Episerver Commerce Tutorials

A Gentle Introduction To EpiCommerce

Creating and planning your first e-commerce project can be a daunting thought. E-commerce websites are complex and in general an e-commerce website will have a lot more moving parts and things to consider compared to a standard website. The primary focus of this post is for beginners completely new to e-commerce with the aim to educate […]

How To Use Trust Signals With Your Episerver Commerce Website To Double Conversations

You might not have come across the term 'trust signal' before but you will have seen it used countless times on most major e-commerce websites. A trust signal is an area or feature on your website that helps builds trust with your website visitors. If people visiting your website don't trust your brand, your product, or […]

EPiServer Commerce : How do I get the current Product or Variant from a controller or attribute ?

There are certain circumstances when working with Episerver or Episerver commerce when you need to come off the beaten track and interact with the HTTP context a bit more closely.  For example, if you need to create a custom ActionFilterAttribute, or, you need to to do some routing wizardry with communication between blocks on your […]

Episerver Commerce The Purchase Order Object Explained

In today's guide, I'm going to cover the build in Episerver purchase order object.  For those new to commerce, the purchase order is the object where you save all the information about the order at the place of purchase.  After the user has paid, all the information about the order needs to be stored in […]

The Episerver Commerce Database Explained - Hopefully...

When we work with Episerver and Episerver commerce, all the data we work with is stored within two back-end databases.  When we build projects, you should never write any form of code that talks to the database directly. Everything should always go via the Episerver API.  If you don't, you can corrupt your installation and […]

How To Add A Custom Property To The Purchase Order in Episerver Commerce

I've talked previously about Adding a custom field into the commerce customer object via code, Adding Custom MetaData to the LineItem Class in Episerver Commerce via Code and Adding Custom MetaData to the Cart Class in Episerver Commerce via Code. In today's post, I'm going to talk about doing the same for the Purchase Order […]

The Different Ways Of Saving Content In Episerver Commerce

Trying to create, update and save objects in commerce can cause quite a lot of confusion. The confusion I generally see around the usage of Episerver commerce API is people using the wrong one and then wondering why it didn't work. In today's guide, I'm going to walk through the different API's that are available […]

How To Automatically Create Association Between Objects in the Episerver Commerce Catalog

When you are working with content within the PIM, you may want to create multiple associations from the products and variants to different types of node.  Before we get into the code, I should probably mention that an association in Episerver commerce is different to the normal Episerver CMS navigation hierarchy structure.  In the CMS […]

How To Store Multiple Objects Against A LineItem Or The Cart In Episerver Commerce

When we work with the basket in commerce, storing multiple custom objects against a line item can be tricky. We can extend line item to have as many custom single properties as you require, but we do not have the option to create new arrays or lists against a line item.  In today's tutorial I […]

Adding Custom MetaData to the Cart Class in Episerver Commerce via Code

I have previously written about how to extend the LineItem class in this article Adding Custom MetaData to the LineItem Class in Episerver Commerce via Code I had a question recently about how to do the same thing for the Cart.  The code to add a custom property is very similar as adding a property […]

The Different Ways Of Getting Items From The Catalog in Episerver Commerce

When you start working with Episerver commerce, you might become overwhelmed with the number of API's available to you.  Finding the right API to do the task at hand can be a frustrating and a time-consuming exercise at times.  The Episerver SDK does hold a lot of information but it can be a bit patchy […]

Adding A LineItem to the Cart In Episerver Commerce

This is another short and simple How To guide. In the latest version of Episerver commerce, we have a new interface available to us called the IOrderRepository, we get access to the order repository the standard way by using a Service Locator or the Injected property (read Dependency Injection In Episerver - ServiceLocator and Injected […]

How To Hook Into Episerver Commerces 8 Catalog Event Handlers

A common requirement on an Episerver Commerce project, is to hook into the commerce pages events handler, for example, you may need to do things like: Call an additional search index when a new game/variants is published Call a third party service, like a pricing service Add custom validation to prevent a product being saved […]

How To Load And Retrieve A Variant or Product From Episerver Commerce

In today's guide, we're going to cover how to get products and variants from Episerver commerce to use on your website. Getting A Product/Variant Using The Code If you want to simply get a reference to a product and you know the catalog or product code, then you can use the ReferenceConverter. Getting A Product/Variant […]

Applying A Promotion To The Marketing Engine In Episerver Commerce

In previous articles, I've talked about Using The New Promotions Engine in Episerver Commerce and The New Order Repository In Commerce. Also, don't forget you need to read this as well How To Enable Beta Features In Episerver.  That covers a lot of the basics but it fails to cover how a content editor can […]

Getting Parent Products and Nodes For a Variant/SKU in Episerver Commerce

In today's guide, we will talk about the Episerver Commerce API, specifically, surrounding parent items.  If you need to get the product, or the node that a variant is associated with then this is for you.  In this example, I'll be using this catalog structure: With the following product and variant: ParentLink When we work […]

Using The New Promotions Engine in Episerver Commerce

In my previous post 'The New Order Repository In Commerce' I went through some of the benefits of using the new order repository that comes with Episerver commerce 8.12.0. NOTE: THIS POST WAS WRITTEN WHEN PROMOTIONS WAS IN BETA.. THE CODE CHANGED SLIGHTLY WHEN IT WAS REALISED INTO PRODUCTION The other new feature from this […]

The New Order Repository In Commerce

NOTE: THIS POST WAS WRITTEN WHEN PROMOTIONS WAS IN BETA.. THE CODE CHANGED SLIGHTLY WHEN IT WAS REALISED INTO PRODUCTION With the release of Episerver commerce 8.12.0 comes a new beta feature for managing promotions and orders. From my initial look, the new system seems a lot more flexible then the old version.  Aside from […]

Upgrading To Episerver Commerce 8 : Virtual path to protected packages is invalid: ''.

When we recently upgraded to Episerver Commerce Manager to Commerce 8 and whenever we tried to view commerce manager, we kept getting a 'Virtual path to protected packages is invalid: ''.' error The fix was to remove all traces of EPiServer.Packaging.dll and EPiServer.Packaging.UI.dll from your commerce project. YOU ONLY DO THIS IN YOUR COMMERCE PROJECT. […]

How To Intialiase the Episerver Commerce MetaClasses in Code

I've blogged previously about Adding a custom field into the commerce customer object via code.  After a recent upgrade to commerce, our DataContext.Current.MetaClasses always returned null in our Intialization module until the commerce migration script was run. A good example why you might want to use this is in your test server deployment. When you […]

How To Fix The Episerver Commerce SeoInformation Description MaxLength Issue

I was recently doing some product content migration for a recent project and part of the import data also included the products metadata/SEO properties for the web page like title, description and keywords tags. I started my import job and, about halfway through, it threw an exception that the MaxLength of the description property had […]

How To Unit Test Episerver Commerce

This might be a bit of a painful post for some people.  Episerver CMS has made amazing progress in the last few years towards creating a platform that is very easy to unit test.  Episerver commerce is making baby steps towards this goal as well, but it's very far behind. Before we start going into […]

How to install Episerver Commerce 7 on MVC Site in less than 10 Minutes!

Now that Episerver has pushed everything to using Nuget, installing Episerver commerce is extremely easy.  First you need to install the Episerver Visual Studio project extension. http://world.episerver.com/documentation/Items/Installation-Instructions/installing-episerver/ This extension will ceate you a brand new Episerver web project with all the required Nuget packages pre-installed for you.  You need to download Visual Studio extension.  You […]

Make The Epi Commerce SiteContext Work From Session Instead Of Cookies

I had a requirement in one of my Epi-Commerce projects that whenever a website visitor signed up to the website and created an account, that account was locked to the default currency for their current location.  This could not be changed as it could potentially allow people to get items at a discounted rate. In […]

How To Search For Users In Episerver Commerce

A key aspect to many websites is building an on-line community. In today's guide I'm going to quickly cover how to get your customer information from Episerver commerce. Getting a user with the Membership User The easiest way to get a user is to use the GetContactForUser method and pass in a MembershipUser.  You can […]

How To Get a Catalogue in Episerver Commerce

If you need to get the root catalogue node in Episerver commerce, you can use the ReferenceConverter API to get a link to the catalogues defined in your project, as follow. You can then filter the catalogue you want via the Name property, e.g. Conclusion Today's guide was very short and simple. We've briefly covered […]

Episerver Commerce : How To Add Custom Properties to the Customers Objects in code

When you use commerce after someone signs-up using the membership provider, you may want to create your own commerce user to store custom data.  For example, on one project when you signed up, you had to supply your date of birth and a newsletter opt-in.  As this is profile information rather than authentication data, a membership […]

Adding Custom MetaData to the LineItem Class in Episerver Commerce via Code

Hey, folks. When we work with the basket in Episerver commerce it is quite likely you may need to store some custom data against a line item. This might be the image of the product, the discount applied to it etc... In commerce manager you can do this with the GUI, however, you can also […]

EpiserverCommerce 7 : Adding a custom field into the commerce customer object via code

We had a requirement on a project to pre-populate a commerce test customer for our dev environment. Whenever the website was first loaded, a test user should be pre-added.  In our scenario the customer had a number of extra properties like had signed up to the newsletter etc.. On a lot of projects, people would […]