Change Order Number generator

By default, the orders numbers are generated by an instance of EPiServer.Commerce.Order.IOrderNumberGenerator. The default number generation is: So, to change this, first we need to inject a custom implementation and remove the default one. On an initialization module that depends on EPiServer.Web.InitializationModule have the following: And my custom order generator, can be like this:

Add migration step with sql script

Scenario: Wanted to add a new schema, table and stored procedure to the same database where CMS is installed. The script should run only once after deployment to an environment. Using IMigrationSet can do this job, although is different from a Initialization Module that run every time the site starts up. Interface IMigrationStep documentation: reading “Add migration step with sql script”

Download images from assets from HTML Anchor tag

Suppose the front-end code wants supply a way to download images from the assets folder. Consider the following code: Assuming that is your EPiServer instance, you can say that the image will be downloaded. Note that download anchor attribute will work if the url is from the same origin of the http request. ForContinue reading “Download images from assets from HTML Anchor tag”

Missing Group on Set Access Rights

Context: Episerver authentication integrated with Azure Active Directory B2C; A fresh installation of Episerver; Virtual roles configured to map Roles configured on AD; Logged only with an account that was mapped for a AD role named ‘SpecialMegaRole’ 😉 Another virtual role was mapped for an AD role named ‘NotSoSpecialRole’ Objective : Set the access rightsContinue reading “Missing Group on Set Access Rights”

Add Metafields to OrderSummary view

I need to add extra information on each LineItem of the order. But also to see it on the OrderSummary view on the Commerce UI. Please comment if i can implement a better solution than following approach, because i thought that it could be a fast solution by changing the xml file were we defineContinue reading “Add Metafields to OrderSummary view”

The view ‘index’ or its master was not found or no view engine supports the searched locations. From IISExpress to IIS

Consider the following scenario: Developing with debug compilation and using IIS Express. Everything works fine without license. Episerver allows development under those circumstances. But if you deploy to a new IIS site or even to Azure web app and you set compilation without debug, because you probably published with Release configuration: The site will showContinue reading “The view ‘index’ or its master was not found or no view engine supports the searched locations. From IISExpress to IIS”

Start from empty folder to a running Episerver CMS and ECommerce

Assumptions: this post was written at 23/10/2019 with Visual Studio 2019 and Episerver CMS Visual Studio Extension version The idea is to create a running empty site with CMS and ECommerce. Ensure that you have Episerer nuget feed configure to Lets create a new empty Episerver CMS site: With this we start toContinue reading “Start from empty folder to a running Episerver CMS and ECommerce”

Setting icons for content types

When creating new types instances, such as pages or blocks, we get a lot of help from the CMS UI identifying which type we want. But, to offer better experience to the editors, it would be much nice that these types could be present with an image. Episerver recomend 120×90 dimention for each icon, butContinue reading “Setting icons for content types”