We are in an era of horizontal learning and now we are going to vertical learning. Digital transformation on learning is not optional anymore as community and business are going faster than education. There is no time to wait for HR to send you to the course, and we need to own our learning ownership!
That is why in Sudo Roux we are pushing for the change, the transformation that needs not just push learning to the next leve but the experience to the next level. UTS was the first starting point, and we are aiming for much bigger. Watch the video and ask us how!
We are back with awesome gathering (obviously online) for our awesome developers. Our agenda:
Darren Stahlhut presents AI 1:1 Personalisation with Episerver Content Intelligence & Recommendations – Darren Stahlhut is Technical Director of Digital @ Empired, with more than 16 years experience across .NET CMS & DXPs. Darren is an Episerver MVP and certified developer of Episerver, Sitecore and Kentico.
Ronil Rangaiya presents “YAML with Deployment API” to setup CI/CD pipelines in Azure DevOps – Ronil Rangaiya is Digital Technical Architect @ Empired, with more than 10 years experience designing and implementing digital experience solutions, Ronil is certified in Episerver CMS and Commerce
it will happen online at Wed, August 5, 2020, 6:30 PM – 8:00 PM AEST. We love to see you all online so if you are interested please register here.
Episerver has quite nice mechanism on validating cart, line item, shipment , , promotion and inventory. I was looking into customizing the line item validtion, to inject some business logic. To do this:
First create new class and inherit from ILineItemValidator
public class CustomLineItemValidator : ILineItemValidator
{
private readonly ILineItemValidator defaultImplementation;
private readonly IOrderRepository orderRepository;
public CustomLineItemValidator(ILineItemValidator defaultImplementation,
IOrderRepository orderRepository)
{
this.defaultImplementation = defaultImplementation;
this.orderRepository = orderRepository;
}
[Obsolete]
public bool Validate(ILineItem lineItem, IMarket market, Action<ILineItem, ValidationIssue> onValidationError)
{
if (AlreadyPurchased(lineItem))
{
onValidationError(lineItem, ValidationIssue.RemovedDueToUnavailableItem);
return false;
}
return defaultImplementation.Validate(lineItem, market, onValidationError);
}
public bool Validate(ILineItem lineItem, MarketId marketId, Action<ILineItem, ValidationIssue> onValidationError)
{
if (AlreadyPurchased(lineItem))
{
onValidationError(lineItem, ValidationIssue.RemovedDueToUnavailableItem);
return false;
}
return defaultImplementation.Validate(lineItem, marketId, onValidationError);
}
private bool AlreadyPurchased(ILineItem lineItem)
{
var alreadyPurchased = false;
var customerId = lineItem?.ParentOrderGroup?.CustomerId;
if (customerId != null)
{
var orders = orderRepository.Load<IPurchaseOrder>(customerId.Value);
if (orders != null)
{
alreadyPurchased = orders.Any(a => a.GetAllLineItems()
.Any(l => string.Equals(l.Code,
lineItem.Code,
StringComparison.InvariantCultureIgnoreCase)));
}
}
return alreadyPurchased;
}
}
In our example above, we are checking to make sure if the user already purchased the item before and if that is a case we return false as a result of validation. It may be weird but our customer has this requirement and it is meaningful in their context. As you can see we are re-using existing line item validator as well.
2. Next step is to inject our new validator to the DI:
[InitializableModule]
public class DependencyResolverInitialization : IConfigurableModule
{
private static readonly ILogger logger = LogManager.GetLogger();
public void ConfigureContainer(ServiceConfigurationContext context)
{
var services = context.Services;
services.Intercept<ILineItemValidator>(
(locator, defaultImplementation) =>
new CustomLineItemValidator(defaultImplementation,
locator.GetInstance<IOrderRepository>()));
}
}
As you can see on DependencyResolverInitialization class, I added a new section to intercept the ILineItemValidator. If you are not sure what I’m speaking of you can read more about it here.
If you are having ‘Commerce Manager’ make sure you do same thing in both CommerceManager and Shopfront projects!
We had a scenario that customer wants to generate a coupon dynamically and use the coupon as credit for the user. The code as everything else in Episerver is quite straight forward:
As you can see we just make sure the campaign is being created and our key in this stage is ‘Campaign Name’ which may be not good enough for some scenarios but for us is enough. Second I’m loading ALL campaigns and iterate through them to find a specific campaign. Again in our scenario, it will not that much effect but if the commerce you are dealing with has MANY campaigns you can use LoaderOptione as below:
As you can see generating a discount is very straight forward. I used ‘BuyQuantityGetItemDiscount’ which fits for my purpose but you can use any out of the box or custom discount you want. Discount which I used ‘BuyQuantityGetItemDiscount’ require to define what catalog item can this discount can be applied. I’m including all current site catalog (I’m getting it from start page which is custom property) but you can use any other method (e.g. iterate through all catalogs and include all catalogs). There is a flag ‘MatchRecursive’ which is set to true, means all descendants of selected items will include in promotion.
So finally we need to call these method full code as bellow:
First Episerver Ascend in the APAC area was very exciting. First I realized how many friends I found through Episerver and it is not just the platform I loved it helped me to find heaps of good friends.
Starting the day Episerver Regional Director APAC Natalia Gamarra kicked off the event with the agenda:
Next Episerver CEO Alex Atzberger spoke about Personalization and Privacy and how it can change the user acquisition:
And focus of Episerver to “empowering growing companies to compete digitally”
Jacob Khan VP, Solution Architecture spoke about the road map and Episerver focus on the personalization:
Next presenter was Niteco spoke about best practices when dealing with digital transformation. Nicola Ayan started with best technical best practices for digital transformation:
And then Michelle Tran follows the conversation on best practice for design and strategy:
Deane Barker had a really good presentation about the content. He thinks “Content ha a soul” which is I agree with him, we need to think about the content as part of our solution:
The concept of personalization is a wide range. I’m working on a project that needs personalization and started to learn. One cool thing I learn from “Foundation” project (Foundation is a very good sample of all Episerver offerings) is how to build a code to use Episerver Tracking Commerce. Again I’m learning and please advise me if I can improve any part of it 🙂
Please read through how to install tracking Nuget package from here
The next step is to create a separate project in your solution and add a commerce tracking package to the solution. Then add a class as below:
The next step is to call the track order. We want to do that when the order is being placed. So after cart converted to purchase order you can call your TrackOrder function:
Recently Episerver announced for Episerver ASP.Net Core program. This is really exciting news, as .Net Community (aka Microsoft!) announced focus more on .Net Core (means no more new version of .Net Framework!). Details of how Episerver is going to do it will be available here. So what is good about it:
The presentation layer can be written on lovely ASP.Net Core platform
.Net Core is lightweight compare to .Net framework. The presentation conceptually would be lean and faster! (I not sure if it would be a case anyway!)
Developers would be happy that they are working on edge technology!
Now what I think would be interim challenges until upgrading the whole platform:
Running two applications (for CMS) and three applications (for Commerce).
For page rendering, another HTTP call required that to be a potential failure point – means when something goes wrong developer needs more time to find the issue and that means more APPLICATION LOGGING!
Page Templates (aka Razor Templates) should be running on both PRESENTATION and EDITOR view. This perhaps makes it quite complicated as now we need ANOTHER project to share MODELS! And the concept of ‘Feature Group‘ we are using for a while needs to be reconsidered – Having said that there could be some ways to avoid duplicated views!
I have a very positive feeling about this Episerver move and I know it would be complicated both for Episerver Devs and external Devs and we all love challenges!
It was a really good gathering and I personally learn a lot.
Damien Dias from Episerver went through Episerver CMS and eCommerce certification exams. He gave a very good brief about what is his journey to get the certifications and shared tips around the main area of the exams.
The second part we had Darren Stahlhut from Luminary that he spoke about the really cool framework called Blazor from Microsoft (it is still not released!) and he married up Blazor with Episerver which was really cool. You read about it more here.
I’m so excited about this meetup. It is going to be on 10 July 2019 6pm – 8pm at Episerver Sydney office! In this session:
Damian Dias will talk about Commerce and CMS Certifications best practices.
Nicola Ayan will talk about Episerver Find and share lessons learned from recent projects.
Marcus Babajews will give you a short update on Episerver Campaign
UPDATE: We are so excited that Darren Stahlhut is joining us and present Episerver Blazor a proof of concept and add-on Episerver Cognitive Services. We are so excited to have him in Sydney 🙂