Sitecore tips and tricks and community news !

Post Top Ad

Post Top Ad

Saturday, March 30, 2019

6:56 PM

SUGPL#9 - International Event in Warsaw

This time we have a special meeting with guests from other countries which wanted to share their experience with SUGPL members. Our second event in 2019 was organized in Warsaw!


Organizers ;)



We have started of course with small introduction



Like at the begining I wrote our presenters came from abroad. So 1st presenter was Atanas Desev from Bulgaria who decribed for us Universal Tracker.


The second one was well known in our community Sebastian Winter from Germany who presented for us SXA.


The third presenter was Mark Cassidy who showed for us approach to speed up 10x Sitecore developemnt.


At the end we had afterparty with lots of burgers ;)


Cheers!

Sunday, March 10, 2019

4:04 PM

Hackathon 2019

It's the 3rd year in a line when I, I should say even "we", are starting Sitecore Hackathon. Last year in 2018 we have won this competition in xConnect module category with a team called "Las Vegans". This time we also tried to make everything to write something cool.

Team

In this year we agreed that we keep "LasVegans" name for the team. But one of our previous members couldn't attend in this year, so we have invited our friend Rafał Dołżyński. Hence we started competition in the below composition
Robert Dębowski
Tomasz Juranek
Rafał Dołżyński

Topic

After last year and winning the xConnect category, we wanted to change something so in this year we choose UI module category.
Our idea was to prepare special mechanism of tagging connected with NL services. We have extended default SXA approach to very manageable tags with big possibilities to customization.

Work

We decided to take the same "sleep approach" like last year when it worked :) Lot's of discussing, coding, talking and writing :) But it was worth it!




Finish

We did it! it was very close because we have finished uploading video and link to it around 3minutes to deadline ;) But we manage to do it ! Success tastes amazing :)! 



Materials




Third, year but still a new experience. But one thing is not changing - exhausted and satisfaction of finishing everything at the end :) 

See you next year!
11:57 AM

xCommerce Extending 2/3 - Policies



At this point we already have known general overview of ways which are possible to extend or customize xCommerce. We did extension of an entity via xCommerce composer tool. But we also have mentioned that there are ways to customize platform from code. We saw 2 main ways, by Policies and Composition, what means the best way - to create independent plugins.

Let's take a look on both of them.

At the beginning what you need is:

Sitecore Commerce Engine SDK, example:




1. Policies

By definition:

A named, versionable and variable set of data that can be used as facts within behaviors to influence behavioral outcomes. source

Policies is the simplest I think approach, but we should avoid using it. Why? Because it has an influence on internal xCommerce code, which can be changed e.g during upgrade. To have less stress and work we shouldn't touch internal xCommerce thing but extend it via composition approach.

Policies you can find in this place inside the SDK solution



Let's assume that we would like to extend our Customer entity. What we should to do is to find this entity in policies and add your custom field.


Yes, we did it! we have added a new property! Is it enough?
- Well, not exactly. We still need create a way to make it visibile outside.

But how to do that?

You still (like in a composition) create you feature project (plugin) and define there a few elements of your change. But...it's still less work than in composition. Usually, needed for you would be , command and controller. In policies like in composition approach your are adding new properties of entity as a new components. Difference is that, when you are changing policy this components are higher in hierarchy of childviews of your entity and you don't have to do much, to later gets them in Sitecore.
By composition approach those components will be buried much more lower to get it.

Now we understand that we have to think about chain of commands and controllers which uses it in xCommerce and extend those places with our custom property. Hence you have to think where you should to go to. To make it very useful is DotPeek, where you can find whole process flow.

Some custom command to make possible to get it like:



And a controller:


So we can say that xComerce part is done. Now we have to go to Sitecore side and try to receive new parameters.

Sitecore side:

Depend what your are doing, in our case it's customer so let's check registration controller which we use and would like to extend with custom fields. In our scenario is our custom controller written with some changes, which gets custom properties pushed by xCommerce in Customer component.









That's it. It's much more faster way to achieve customization of xCommerce entity - but remember that you are changing internal commerce files ! :)

Cheers!