Feature aware Razor Pages, Orchard Core Commerce - This week in Orchard (06/05/2022)

Gábor Domonkos's avatar
Announcement, Query, Documentation, This week in Orchard

This week you can read that the Feature attribute was not working for Razor Pages, the Lucene documentation updates, and a demo of the Orchard Core Commerce module! Are you interested in the details? Check out this post for more!

Orchard Core updates

Feature attribute was not working for Razor Pages

The Feature attribute was not applied to Razor Pages because Razor Pages were always tied to the module. What does it mean? Well, let's follow the steps below:

  1. Create a Module with a feature.
  2. Add a Razor Page.
  3. Add the Feature attribute to a Razor Page.
  4. Enable the module and the feature it will serve the Razor Page.
  5. Disable the feature - notice that Razor Page is still served.

Now, the feature is disabled, and the site should not serve the Razor Page, but it was still served. Now, this has been fixed and you can also try it out if you enable the Orchard Core and Orchard Foo Demo features that sit in the Orchard Demo project. Note that this project is not referenced by default, so if you would like to try it out, you can simply add it to the OrchardCore.Cms.Web, for example.

A Razor Page with the Feature attribute

You can find two Razor Pages (Edit and List) with the Feature attribute OrchardCore.Demo.Foo. Meaning that if you enable the Orchard Demo feature but keep the Orchard Demo Foo disabled, you can not reach these pages.

Lucene documentation updates

You can write elaborate Lucene Queries with the ElasticSearch DSL. This includes the match query type (akin to using the my search term syntax in the search box) and match_all (like writing "my search term" for exact search). And you can optionally use the parsed Lucene search syntax in the search text box. However, the documentation of the Lucene module had some missing examples about how you can combine the two and how to use the search syntax with a Query. The simple_query_string is also available but was missing from the docs, it has been added too.

Lucene documentation updates

Demos

Orchard Core Commerce

Orchard Core Commerce will be 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 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 gets rid of the now obsolete origins and establishes our ambition for the module to become the go-to commerce module for Orchard Core.

This work is in its initial design phases and will focus at first on porting a minimum viable feature set.

Minimum viable product features

In this demo, we will check out the current state of the module. To set up your dev environment, you should clone this repository, build and run the SampleWebApp project (set up with any recipe) and enable the Orchard Core Commerce, Orchard Core Commerce Session Cart Storage, and the Orchard Core Commerce Settings Currency Selector features. From now on, you can start using the features by creating a new Product content type and adding the Product part to it, and so on. But you can run the built-in recipes (MultiCurrencyProduct, Order, and Product) to set up your content model just by a few clicks. Meaning you will have a

  • Product content type with a Product Part and multiple Price Parts.
  • Order content type with an Order Part, a shipping address, and a billing address.
  • Product content type with a Product Part and a Price Part.

Edit a Product content item

And if you check out the recording below you will know how to create products like this one, where you can define the SKU(Stock Keeping Unit), the base price of the product, and you have the option to attach the built-in Boolean/Numeric/Text Product Attribute Fields that can help you to define the available sizes for the given T-shirt for example.

News from the community

Lombiq provides stewardship for Orchard Core Commerce

You saw the current state of the Orchard Core Commerce module, and if you follow the news around Orchard and Orchard Core, you may notice that the project is moving a little slow because of the level of the contributions.

We'd like to announce that Lombiq Technologies provides stewardship for the Orchard Core Commerce project. Bertrand, who initially founded the Orchard 1 and Orchard Core Commerce modules, reached out to us if we are interested in actively maintaining the project. We at Lombiq are really excited about this opportunity. We want to move this forward with proper planning and frequent contributions to the repository.

On our side, Márk Bartha will be the project leader. A few seasoned Orchard developers are ready to implement features. But first, we want to hear your opinion about what you need first and most for the MVP. We'll put together a short survey to collect your ideas in an organized manner. Until then, feel free to comment and let us know your thoughts!

Orchard Dojo Newsletter

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

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

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

No Comments

Add a Comment