Create system roles by default, Orchard Core Commerce 3.0 - This week in Orchard (07/02/2025)

Support depends-on when using script and style inline, creating system roles by default, and announcing the 3.0 release of the Orchard Core Commerce project are the topics for this week! Without further ado, let's get started!

Orchard Core updates

Support depends-on when using script and style inline

The depends-on attribute available in script/style Tag Helpers should work the same as declaring a dependency in a resource manifest and causing the dependency to be included. This doesn't happen, though, and the dependency is not included. The dependency order is only enforced when it was already included before. Let's say you add a script into one of your Razor files, like:

<script at="Foot" depends-on="jquery-resizable">
    console.log("hello");
</script>

If you visit the page, you will notice that the script is included, but jquery-resizable is not. But if you add <script asp-name="jquery-resizable"></script> a line above, jquery-resizable will be included correctly above the inline script. So, the issue here is that jquery-resizable should also be included and registered when it's just a dependency.

From now on, the ScriptTagHelper and the StyleTagHelper will support registering the resource inline using the depends-on attribute without declaring the resource directly.

Support depends-on when using script and style inline

Create system roles by default

We have three default System roles coming from OrchardCore.Roles.Core: Anonymous, Authenticated, and Administrator. The goal of this change is to pre-create the three roles from the OrchardCore.Roles module, with their default descriptions, and remove them from the built-in recipes.

We introduced a new interface called ISystemRoleProvider with a default implementation called DefaultSystemRoleProvider. We have a new migration (SystemRolesMigration) that calls the GetSystemRoles method of this implementation, which creates these roles using the RoleManager, making sure that these three roles will be available in Orchard Core by default without the need to set these up from a setup recipe.

The new DefaultSystemRoleProvider provider

News from the community

Orchard Core Commerce 3.0

Orchard Core Commerce is an Orchard Core port and partial rewrite of the open-source Nwazet Commerce module that was built for Orchard CMS 1.x. Nwazet Commerce was initially built in 2012 by Bertrand Le Roy, loosely based on a commerce sample by Sipke Shoorstra. The initial goal of Nwazet Commerce was to power the website of the hardware startup Nwazet. While Nwazet is no longer operating, the Nwazet Commerce project went on and was further developed by a group of passionate contributors who are using the platform for their own, and their customer's websites.

Like Orchard, Nwazet Commerce was built with extensibility in mind, and as such, it has its own extensions (typical examples include local tax and shipping modules). It's also a pure, idiomatic Orchard.

Orchard Core represents a major evolution of the Orchard design principles and is sufficiently different that running Nwazet Commerce on it will necessitate significant work. As such, the community decided that starting from a blank slate was the best way to go, so they will port Nwazet Commerce piece by piece, being careful to accurately apply Orchard Core's new design principles. The community also decided to adopt a new name that will get rid of its now obsolete origins and establish our ambition for the module to become the go-to commerce module for Orchard Core.

Back in 2022, we published a demo where you could see the module's current state. A few months later, we reached another milestone when we finished the basic implementation of Stripe Payment integration (without taxation, shipping, etc.). Stripe is a payment service provider that business owners can use to accept dozens of payment methods, from credit cards to buy now, pay later services. Stripe Payments handles the steps between a customer providing their card information and learning that their payment has been accepted.

As you may know, Lombiq provides stewardship for the Orchard Core Commerce module. That means that we do code reviews and work on features and fixes. At the beginning of 2023, we released the 1.0 version of the Orchard Core Commerce module! You can read some of the key features of the release in this post. You can easily try it out by cloning this repo and building and running the OrchardCore.Commerce.Web project. Thanks to Auto Setup, the site will be set up with the OrchardCore Commerce - Development recipe. After, you can go to the dashboard, using the credentials admin and Password1!, and go to Content -> Content Items to create your first Product.

Last week, we released the 3.0 version of the Orchard Core Commerce module, which officially supports Orchard Core 2.1! This is a major version increment because there are some breaking changes, so watch out! One of the breaking changes is that we dropped Newtonsoft.Json support, replaced the IPayment interface, and now services and modules use Payment directly, which was also moved into the OrchardCore.Commerce.Abstractions library. Check out the full list of changes here and the release notes here.

Orchard Core Commerce 3 Release Notes

Orchard Dojo Newsletter

Lombiq's Orchard Dojo Newsletter has 460 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published in Orchard Dojo, including This week in Orchard, of course.

Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here!

If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!