How to Extend Bizfx Interface to Support Import/Export Features in Sitecore Commerce 9 (Part 1)

sitecore-techtalks
In the previous blog posts, I explained how to implement Import Price Books and Export Price Books features for Sitecore Commerce. In this blog post, I will explain how to extend BizFx interface to support import/export features.

You can find the source code here: https://github.com/Frog911/Sitecore.Commerce.ImportExport

I would add two buttons for importing and exporting Price Books to PriceBooks Dashboard.

It will be required to create PopulateImportPricingDashboardActionBlock:

Sitecore Commerce 9: Extend BizFx Part 1

After that, I would create GetPricebookExportViewBlock, which will build a view with a Download File component. It will be possible to provide the path where the exported file should be saved.

Sitecore Commerce 9: Extend BizFx Part 1

For supporting File Upload, we have to create another ViewBlock. It will provide a possibility to select file for import process.

Sitecore Commerce 9: Extend BizFx Part 1

Now we have to create DoActionPricebookImportBlock, which will be responsible for reading the imported file stream and starting the import of Price Books. The importing process will run as a long running operation. As a result, it will send the response TaskId. From the BizFx website on the front end side a call will be triggered to check the status by TaskId with an interval of few seconds.

Sitecore Commerce 9: Extend BizFx Part 1

In addition, we have to register our created blocks as our last step:

Sitecore Commerce 9: Extend BizFx Part 1

That is all what we have done from the Sitecore Commerce Engine prospective.

In the next blog post, I will explain how to extend BizFx website to support this logic.

Stay tuned!