Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

4/10/2015 IDeliverable 

­ Writing an Orchard Webshop Module from scratch ­ Part 1

Writing an Orchard Webshop


Module from scratch - Part 1
orchard (/Tags/orchard)

In this blog post series we will walk through the process of building

an Orchard module from scratch.

Orchard is an awesome CMS with powerful features and inspiring architecture that allows for
unlimited extensibility, but it might take some time to fully understand it's architecture and
being able to customize all aspects of your own Theme or even create your custom modules that
integrate with all the extensibility points of Orchard.

It is my hope that you will benefit from the knowledge I gained along the way and that you will
come to see the beauty of Orchard and its architecture. Not only is it just great for simple or
advanced websites and blogs, but it's very much a base platform for building all kinds of
webbased applications such as e-commerce backends, CRM's, supportticket systems, project
management, community sites, learning management systems and so forth. Basically anything
you would do from scratch should be considered being built using Orchard. Orchard is actually
more of an extensibility framework than it is "just" a CMS. You plugin your own modules that
can do anything which a regular ASP.NET MVC application also can, with the added benefit that
Orchard has a rich set of features and composibility concepts of which you can take advantage.

The primary audience of this post are ASP.NET MVC developers who are just getting started
with Orchard.
Before diving in though, I strongly encourage you to read the following articles upfront if you
haven't already:

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 1/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

http://docs.orchardproject.net/Documentation/How-Orchard-works
(http://docs.orchardproject.net/Documentation/How-Orchard-works)
http://msdn.microsoft.com/en-us/magazine/hh708754.aspx (http://msdn.microsoft.com/en-
us/magazine/hh708754.aspx)

Webshop Features
In this tutorial, we'll create a commerce module with the following features:

The administrator will be able to turn any ContentType into Products by attaching a
ProductPart.
Site visitors (customers) will be able to add products to a shopping basket, register with the
site and be registered as a Customer
The customer will be able to proceed to checkout and pay for the selected products using
an online payment service provider (PSP) (in our demo, we will use Ogone
(http://www.ogone.com/) a simulation PSP).
Before the customer is redirected to the PSP, the system will create an Order record, with
child OrderDetail records.
After the order is paid by the customer, we need to handle the delivery of the product. In
the case of physical products, we might want to notifiy some shipping partner. In the case
of virtual products, we might want to generate something like a voucher, or do anything
else that is appropariate for the product. To enable this kind of flexibility, we will
implement some sort of IShippingProvider interface, for which we will create two simple
implementations: one that sends an email notification to a shipper, and another one that
will generate a voucher.
The Admin backend will enable the administrator to manage both Customers as well as
Orders.

(note about the embedded screenshots: some screenshots appear too small to be viewable.
Until I fix that you can simply drag the picture to your browser's address bar to see the picture
in its original size)

Allright, let's get started with building the Orchard Webshop Module!
http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 2/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

Part 1 - Introduction (you are here)


Part 2 - Setting up your Orchard Development Environment (writing-an-orchard-webshop-
module-from-scratch-part-2)
Part 3 - Creating a Module (writing-an-orchard-webshop-module-from-scratch-part-3)
Part 4 - Creating the ProductPart (writing-an-orchard-webshop-module-from-scratch-part-4)
Part 5 - Creating and rendering the ProductCatalog content type (/blog/writing-an-orchard-
webshop-module-from-scratch-part-5)
Part 6 - Creating the ShoppingCart service and controller (/blog/writing-an-orchard-webshop-
module-from-scratch-part-6)
Part 7 - Rendering the ShoppingCart and ShoppingCartWidget (/blog/writing-an-orchard-
webshop-module-from-scratch-part-7)
Part 8 - Registering new Customers with the site (/blog/writing-an-orchard-webshop-module-
from-scratch-part-8)
Part 9 - Creating Orders and Communicating with the PSP (/blog/writing-an-orchard-webshop-
module-from-scratch-part-9)
Part 10 - Managing the Customers and Orders from the backend
(/blog/writing-an-orchard-webshop-module-from-scratch-part-10)Part 11 - Customizing the
Product and Catalog content list in the Admin: DisplayTypes (/blog/writing-an-orchard-
webshop-module-from-scratch-part-11)
Part 12 - Integrating with an ERP system 
Part 13 - Handling Shipping and Taxes  
Part 14 - Implementing payment methods: Google Checkout
Part 15 - Implementing payment methods: PayPal

 11/18/2014 10:54 PM by Sipke Schoorstra (/blog/author/sipke)

28 comments
Juanzete 02/01/2012 12:08 AM

This is AMAZING

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 3/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

fabrizio 02/12/2012 11:20 AM

Great Tutorial
Thanks a lot

Ali_ta_4000 02/25/2012 10:16 AM

Thanks alot

Luther Lindsay 02/28/2012 04:56 AM [http://www.tatvasoft.co.uk/]


(http://www.tatvasoft.co.uk/)

When you are developing Orchard modules for the first time, you will face
some error while installing and making changes to the module. It might be
possible that you want to reset Orchard CMS from the beginning as if
Orchard was run for the first time, in such cases the best way to reset is to
delete the data folder which you created.

Zgofmontreal 03/01/2012 05:45 PM

in ur new Nwazet.Commerce in the gallery, I notice that there r no


ProductCatalog. does it mean we should use projection module to get the
same result? thx. andy

webwinkel beginnen 03/03/2012 09:00 AM


[http://www.webmeester.eu/index.php/webwinkel-service/]
(http://www.webmeester.eu/index.php/webwinkel-service/)

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 4/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

I am sure that you will benefit from provided the knowledge for all web shop.
It is really great news for software development. Not only it is just great for
software and advanced web site. I am enjoying of this blog.

Sipke Schoorstra 03/03/2012 11:23 AM [http://www.ideliverable.com]


(http://www.ideliverable.com)

The Projection module would be perfect for that, yes. It would also
circumvent the limitation that you can either show all content types, or just
one. Projector allows you to select exactly which content types to show.

Your Mom 03/22/2012 11:56 AM

If you love it so much why dont you merry it!!!!!!!

Software Development Company 04/17/2012 06:01 AM


[http://mindinventory.com/] (http://mindinventory.com/)

Orchard is powerful CMS with powerful features and inspiring architecture


that allows for unlimited extensibility, it might take some time to fully
understand it's architecture and being able to customize all aspects of your
own Theme!

Rob Hurt 05/10/2012 05:09 PM

data folder = all the files/ folder in app_data, right?

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 5/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

Sipke Schoorstra 05/11/2012 07:17 AM [http://www.ideliverable.com]


(http://www.ideliverable.com)

That's correct.

Samuelshirley 06/19/2012 06:34 PM

Excellent articles!! They helped me out greatly!

Are there any plans to work on Parts 11 - 15?

Sipke Schoorstra 06/22/2012 12:08 PM [http://www.ideliverable.com]


(http://www.ideliverable.com)

I'm glad, thanks!


There are currently no concrete plans to work on parts 11 - 15 due to a lack of
spare time.
However, as I'm moving to Orchard development more and more, I'll
probably come across these subjects sooner or later. And that's when I'll be
blogging about them.

Guest 08/06/2012 02:51 PM

Great!!! I really like these articles!!! But what about Parts12-15? I'm looking
forward to implementing PayPal...

Sipke Schoorstra 08/11/2012 01:57 AM [http://www.ideliverable.com]


(http://www.ideliverable.com)

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 6/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

Thanks! I'm not sure, it depends on when I'm actually going to need it myself.
Probably before the end of this year. A blog post will then soon follow.

Abhishek Luv 08/30/2012 02:14 AM [http://www.codeabstract.com]


(http://www.codeabstract.com)

Thanks for this awesome module tutorials.

With Regards Abhishek Luv

Kewngen 09/14/2012 09:42 AM

You haven't given up on this awesome tutorial I hope?

Sipke Schoorstra 09/14/2012 08:44 PM [http://www.ideliverable.com]


(http://www.ideliverable.com)

No, just a bit short with time lately. Anything specific that you'd like to see
handled?

Kewngen 09/17/2012 11:04 AM

Is it OK to say everything? :P
I haven't started yet (I too have time issues!), I'm just happy I've got 11 parts
before I get to a unwritten one.

It would be nice if you got the basics up for part 12-15, even if you have to skip
some of the fancy stuff. And if you have time afterwards, update the posts to
1.5 (or 1.6 by then).

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 7/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

Sounds like I'm ungrateful, I'm not! Thanks for a awesome tutorial!

ElyorLatipov 09/22/2012 12:21 PM

Good article!,thx...

Ytrog 11/02/2012 12:21 PM

The link to the demo isn't working

Sipke Schoorstra 11/02/2012 10:14 PM [http://www.ideliverable.com]


(http://www.ideliverable.com)

Thanks! Should be working again.

AmethystBoyer 11/27/2012 04:39 AM [http://demetriagordon.webnode.com/]


(http://demetriagordon.webnode.com/)

Great article and very very exciting weblog. That is one thing I’m really
anticipating. Awaiting studying more from you next weeks time.

AmethystBoyer 11/27/2012 04:39 AM [http://demetriagordon.webnode.com/]


(http://demetriagordon.webnode.com/)

Great article and very very exciting weblog. That is one thing I’m really
anticipating. Awaiting studying more from you next weeks time.

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 8/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

Mike 12/10/2012 08:01 AM

Interesting article!
But the Demo isn't working :(

Barry Terry 12/20/2012 05:50 AM [http://sophiavinson.yolasite.com/]


(http://sophiavinson.yolasite.com/)

The Orchard CMS management interface is a properly analyzed imitation of


WordPress. Since this has always been one of WordPress's powerful matches
comparative to other CMS, this was a intelligent shift. It also has the
advantage that customers that are acquainted with WordPress with easily
adapt to Orchard.

Christian Lawson 12/21/2012 06:49 AM [http://joshuaclayton.weebly.com/]


(http://joshuaclayton.weebly.com/)

It's very much a platform foundation for building all kinds of webbased
programs such as e-commerce backends, CRM's, supportticket techniques,
Project control software, group sites, learning control techniques .

bathroom cleaning 01/26/2013 10:06 AM [http://www.choni.es/index.php?


do=/profile-2213/info/] (http://www.choni.es/index.php?do=/profile-
2213/info/)

No matter if some one searches for his vital thing, so he/she wants to be
available that in detail, thus that thing is maintained over here.

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 9/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

Leave a comment
Name:

Enter your name

Email address:

Enter your email address

Not displayed on the site, used to obtain Gravatar image.

URL:

Enter your website URL

Comment:

How to Format

Type the text
Privacy & Terms
(http://www.google.com/intl/en/policies/)

Submit

 Subscribe to IDeliverable Blog (RSS)


(/rss?containerid=32)

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 10/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

 Subscribe (email) (/subscribe)

Topics
autofac (1) (/Tags/autofac) azure (2) (/Tags/azure) cloud services (2) (/Tags/cloud%20services)

codemirror (1) (/Tags/codemirror) globalization (1) (/Tags/globalization) jquery (1) (/Tags/jquery)

knockoutjs (1) (/Tags/knockoutjs) linqjs (1) (/Tags/linqjs) orchard (33) (/Tags/orchard)

orchard harvest (1) (/Tags/orchard%20harvest) performance (2) (/Tags/performance)

powershell (2) (/Tags/powershell) ssl (1) (/Tags/ssl) startup tasks (2) (/Tags/startup%20tasks)

webapi (1) (/Tags/webapi)

Authors
Daniel Stolt (/blog/author/daniel)
Daniel is the go-to guy here at IDeliverable for all things Azure. He
blogs about his experiences developing for the cloud.

(/blog/author/daniel)

Sipke Schoorstra (/blog/author/sipke)


Sipke is the resident Orchard CMS specialist here at IDeliverable. He
blogs about site building and module development.

(/blog/author/sipke)

Archive
http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 11/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

2014 2013 2012


November (6) December (2) October (1)
(/blog/archive/2014/11) (/blog/archive/2013/12) (/blog/archive/2012/10)
September (3) June (5) September (3)
(/blog/archive/2014/9) (/blog/archive/2013/6) (/blog/archive/2012/9)
March (9) August (1)
(/blog/archive/2013/3) (/blog/archive/2012/8)
January (1) April (7)
(/blog/archive/2013/1) (/blog/archive/2012/4)
February (4)
(/blog/archive/2012/2)
January (18)
(/blog/archive/2012/1)

Postal address:
IDeliverable, Ltd.
PO Box 58341
3733 Limassol
CYPRUS

Visiting address:
IDeliverable, Ltd.
Sotiri Tofini 4, 2nd floor
Agios Athanasios
4102 Limassol
CYPRUS

VAT number: CY10318155U


TIC number: 12318155W
info@ideliverable.com (mailto:info@ideliverable.com)
http://www.ideliverable.com (http://www.ideliverable.com)

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 12/13
4/10/2015 IDeliverable ­ Writing an Orchard Webshop Module from scratch ­ Part 1

All information on this website copyright © 2015 by IDeliverable, Ltd.

http://www.ideliverable.com/blog/writing­an­orchard­webshop­module­from­scratch­part­1 13/13

You might also like