Shop
The Magnolia Shop Module offers default e-commerce functionality for Magnolia CMS. At its core, it provides a flexible data structure and a set of classes for handling the data. It is then up to the integrator to define the look and behavior of the shop. It is delivered with a set of default paragraphs for the "pop" theme of the Magnolia Standard Templating Kit. fastforward initiated the project and developed the first version in collaboration with Magnolia International Ltd. and continues to extend the shop's functionality.
- Products, product categories, prices and currencies are managed in AdminCentral.
- All data is stored in the Data module except shopping carts in their own workspace.
- Complete website structure with shop, product detail and shopping cart pages.
- Teaser paragraphs for promoting featured products, campaigns and items on sale.
- Checkout process implemented with multi-step form.
- Run multiple shops in a single Magnolia CMS instance. Different products, countries and currencies.
- Each shop can have its own security. Grant editors permission to shops they work with.
- Downloading
- Installing
- Known limitations
- Configuring a shop
- Tax categories
- Currencies
- Price categories
- Setting a default currency
- Customization example: Multiple currencies
- Creating pages
- Products
- Security
- Integration
Downloading
Download the Shop module from Magnolia Store or Nexus repository.
Shop depends on the following modules which you also need. Magnolia CMS Enterprise Edition bundle already has them except for OCM. Update the Form module too.
- Magnolia CMS 4.4.2
- Admin Interface 4.4.2
- Templating 4.4.2
- Standard Templating Kit 1.4.2
- Resources 1.4
- DMS 1.5.1
- Mail 4.4.2
- Data 1.6.1
- Form 1.3.1 or later
- FCK Editor 4.4.2
- OCM 1.0. Used to save the shopping cart bean and cart items to nodes, to distribute order numbers (order number is the name of the cart node), and to configure what to save.
- Jackrabbit OCM 1.5.3
Installing
To install the Shop module:
- Stop Magnolia CMS.
- Add the Shop module .jar file and any dependent modules that you don't have yet to
WEB-INF/libfolder on all instances. - Start Magnolia CMS and run the Web update.
Known limitations
- Products in a given shop can be priced in only one currency at a time (default currency). To change this behavior, write a custom price category manager.
- You cannot define different prices for different variants (sizes, colors) of the same product.
- No payment processing is included.
Configuring a shop
The module ships with a sample shop that you can customize to your liking or create a new one. You can find the sample shop in the demo features project in /demo-features/modules/sample-shop.
To create a new shop:
- In AdminCentral, go to Shops Management.
- Click New Item.
- Give the shop a Name.
- Give the shop a Title.
- Click Save.

Tax categories
Value added tax (VAT) is levied at different rates on different products. It is calculated as a percentage of the net price. You can create several tax categories such as normal goods at 7.6%, reduced at 2.4% and so on. Tax is added to the price at checkout. The amount of tax applied to a particular product depends on the price category the product belongs to.
To create a tax category:
- In AdminCentral, go to your shop menu and click Tax categories.
- Click New Item and fill in:
- Tax category ID is a unique ID for the category. For example,
001-Books. The ID can contain letters, numbers and special characters with certain exceptions. - Title is the name of the tax category that is displayed to editors when they add products, for example
Books. - Tax is a numerical value of the tax percentage. For example, if a VAT of 7.6% is levied on books, enter
7.6into this box. The number format is Double where decimal point is a period. - Click Save.
Currencies
The Shop module supports multiple currencies. This is useful for large shops with a global customer base and shops that are located near a two-country border.
Important! While it is possible to configure multiple currencies, only one of them is used at a time. Customers cannot switch between currencies in the default implementation; all products are priced in the default currency.
To create a currency:
- In AdminCentral, go to your shop menu and click Currencies.
- Click New Item and fill in:
- Currency ID is the unique ID of the currency such as
USD,EURorCHF. It is displayed to editors when they edit product details. - Title such as
$,€orCHF. It is displayed to customers next to the product price in the shop. - Formatting convention. Set the format used to display currency so that it matches the currency's locale. Whole numbers are represented with a number sign # and parts with zero 0. For example, U.S. cents are separated from whole dollars with a period and a comma is used as thousands separator, such as in 1,234.56. Formatting for dollars is therefore
###,###.00. The corresponding convention for Swiss Francs is 1'234.55 (###'###.00) and for euros 1.234,56 (###.###,00). - Click Save.
Price categories
Price category defines the currency in which a product is sold and whether tax should be applied.
To create a price category:
- In AdminCentral, go to your shop menu and click Price categories.
- Click New Item and fill in:
- Price category is a unique ID for the category such as "Standard selling price" or "Tax-free Swiss franc". The ID is displayed in AdminCentral, not in the shop.
- Title is displayed to editors who set product prices. Make the title descriptive and immediately understandable such
Tax-free Swiss franc. - Currency. Select a currency. Options on this list are created in Currencies.
- Tax. Whether the price includes tax or not.
- Click Save.
Setting a default currency
By default you can display products in only one currency at a time. Even if you define multiple currencies, only one of them is the default currency. The currency to use is inherited from the price category.
To set the default currency:
- In AdminCentral, go to Shops Management.
- Select the shop node from the tree and click Edit Item.
- Go to the System tab.
- Set the value of Default price category ID to the name of the price category node that uses your default currency such as
Standard-selling-price. - Click Save.
Customization example: Multiple currencies
Suppose you sell the same product in two different currencies: euros and Swiss francs. Customers who pay euros come from the euro area where your shop is located so they need to pay value-added tax (VAT). Swiss franc customers come from across the border in Switzerland so no tax is levied on their purchases. You need two price categories: Standard selling price and Tax-free Swiss franc. You also need to allow customers to choose the currency in which they wish to pay for products.
Recommended approach:
- Create two price categories.
- Write a custom price category manager class that allows switching between the categories. See DefaultPriceCategoryManagerImpl for the default implementation.
- Configure your shop to use the custom price category manager:
- In AdminCentral, go to Shops Management.
- Select a shop node on the right and click Edit Item.
- Go to the System tab and set the value of Price category manager class to the fully qualified name your custom class.
- Add a dropdown or link control on the shop Home page that allows the customer to switch between currencies.
Creating pages
The Shop module installs a sample shop that contains all the required Web pages. Use the sample for your shop as such or copy it. The pages are in /demo-features/modules/sample-shop.

Shop home
Shop home page is a typical section page. It teases a few selected products that you want to promote and provides navigation to product categories.

To create a home page:
- Go to Website workspace.
- Create a new page.
- Give the page a name and title.
- Double-click the Template column and set template to Shop Home.
- Open the page and click the Page Info button.
- From the Shop Name list, select the shop to display.
- Click Save.
Product category
Categories organize the products sold in the shop. A book shop might have categories such as Travel, Gardening and Audiobooks. The Travel category might split further into Europe, Latin America and Middle East. The purpose of categories is to help customers browse the shop and find products they are interested in.
Each category is a page in the shop site hierarchy. Make sure your category taxonomy is logical. It makes finding products quicker.

To create a product category page:
- In AdminCentral, go to Website.
- Browse to your shop home page and create a new child page.
- Give the new page a name and a title such as "Books".
- Double-click the Template column and set template to Product Category.
Product Details
Product Details page displays all information about the selected product, including the full description which is not displayed in teasers or search results.
To create a product detail page:
- In AdminCentral, go to Website.
- Browse to your shop home page and create a new child page.
- Give the new page a name such as
product-detailand a title such as "Product Detail". - Double-click the Template column and set template to Product Detail.
Shopping Cart
A customer lands on the Shopping Cart page when they start the checkout process. Prices of all units are totaled and VAT is added if applicable. In the cart the customer can add and remove units of a product using the plus ( + ), minus ( - ) and delete buttons.

To create a shopping cart page:
- In AdminCentral, go to Website.
- Browse to your shop home page and create a new child page.
- Give the new page a name such as
shopping-cartand a title such as "Shopping Cart". - Double-click the Template column and set template to Shopping Cart.
- Optional: Edit the page, click Page Info and hide the page from navigation. Category and product detail pages already include a component that displays a summary of shopping cart contents and allows the customer to navigate into it.
Checkout form
Checkout is a three-step form that asks the customer to provide a shipping address, a billing address and confirmation.
Shipping address
To create a shipping address page:
- In AdminCentral, go to Website.
- Browse to your shopping cart page and create a new child page.
- Give the new page a name such as
checkout-formand a title such asShipping Address. This is the first step in the three-step process. - Double-click the Template column and set template to Checkout Form.
- Open the page and create form fields for capturing a shipping address.
Billing address
To create a billing address page:
- In AdminCentral, go to Website.
- Browse to the Checkout Form page and create a new child page.
- Give the new page a name such as
billing-addressand a title such asBilling Address. This is the second step in the three-step process. - Double-click the Template column and set template to Shop Form Step.
- Open the page and create form fields for capturing a shipping address.
Confirm Order
The third step of the form summarizes the order and asks the customer to confirm it.
To create a confirm order page:
- In AdminCentral, go to Website.
- Browse to the Checkout Form page and create a new child page.
- Give the new page a name such as
confirm-orderand a title such asConfirm Order. This is the final step in the three-step process. - Double-click the Template column and set template to Confirm Order Form Step.
- Open the page. The order summary table is added automatically.
- Add a new field set and Previous and Next buttons inside it.
Confirmation
Once the order is successfully submitted, the customer is given an order number.

The order number matches the shopping cart node name in AdminCentral. Completed orders are stored in Shops Management > Shopping Carts.

The default SaveAndConfirmFormProcessor class converts the order JavaBean object to nodes and properties using Jackrabbit's Object Content Manager (OCM) framework. This functionality is provided by the Magnolia OCM module which is required.
You can export the order to a third party warehouse or ERP system by writing a custom shopping cart processor.
Products
Products are the items sold in the shop: books in a book shop, songs in a music shop and so on.
To create a product:
- In AdminCentral, go to your shop menu and click Products.
- Click New Item and fill in:
- Product is a unique ID for the product. In a book shop it could be the ISBN number of the book such as
978-1613820773for A Tale of Two Cities by Charles Dickens. The ID can also match a product ID in an external warehousing system if you import products into Magnolia CMS. Use IDs that make sense for your products. The ID is not displayed to customers in the shop by default. - Title is the product name displayed to customers. Use titles that customers would expect to find when searching for products.
- Description (short) is a brief description of the product. It is displayed in product teasers, list paragraphs and search results.
- Description (full) continues the short description. Don't repeat the text of the short description in the full description! The full description is appended immediately after the short description on the product detail page. If you repeat the text, it will be repeated in the shop.
- Choose image type. Upload a product image from your computer or select one from the DMS. This is a standard Digital Asset Management (DAM) control that is configurable and extensible for selecting images also from other sources such as third party image repositories. The product image is displayed in teasers, lists and product detail paragraphs in the shop.
- Go to the Product categories tab and check the categories the product should belong to. The categories come from the category pages under the shop home page. When you check a box, the product will be displayed in that category page. For example, if you categorize a book such as A Guide to the Gardens of Kyoto as both Gardening and Travel, it will be displayed to customers on both category pages. Another example is a book that includes a CD. It could be categorized as a book and an audiobook.
- Go to the Pricing tab.
- Enter the Prices.
- Apply a Tax category.
- Go to the Keywords tab and add any keywords managed in the Categorization module. Keywords are displayed on the category page. They help users find related content.
- Click Save.

Product variants
Product variants are options within one product such as sizes or colors. For example, if you sell the same shirt in different sizes you can create variants S, M, L and XL. Or the same bicycle in red and black.
To create product variants:
- In AdminCentral, go to your shop menu and click Products.
- Select a product content node and click New Item. This is the variable such as color.
- Fill in:
- Name is an internal name displayed in AdminCentral. It is not displayed in the shop. For example,
color. - Title is displayed to customers in the shop. For example,
Color. - Description is not displayed anywhere by default. You could customize the paragraph template to display the description as a tooltip such as “Click to select a color”.
- Click Save.
- For each option:
- Click New item.
- Fill in:
- Name is an internal name displayed in AdminCentral. It is not displayed in the shop. For example,
black. - Title is displayed to customers in the shop. For example,
Satin black. - Description is not displayed anywhere by default.
- Click Save.
Teasing products
Use the Shop Product Teaser paragraph to showcase an item such as a product that is on sale. The purpose of a teaser is to promote the product and invite the customer to find out more.
To tease a product:
- Open the shop home page or a product category page.
- Add the Shop Product Teaser paragraph into the Main or Extras area.
- Select a product to tease.
- Optional: Overwrite the product title and description. This is a good place to write promotional text.
- Click Save.
Security
By default, editors do not have permission to access shop configuration. Shop specific menus in AdminCentral are not visible to editors.
Shop pages are visible and editable to editors in the site hierarchy. This means that editors can edit products through the Edit Product link.
Each shop can have its own security. This allows you to grant editors permissions selectively to the shops they work with. For example, a U.S. editor can have permission to the U.S. shop, a German editor to a euro shop, and a managing editor to both.
Access to shop resources is controlled with an access control list (ACL). An ACL consists of one or more rules where permissions are applied to the controlled resource. The ACL itself defines what permission is granted. Attaching the ACL to a role defines who has the permission. To learn more, see Magnolia CMS Security.
Create a shop editor role
To create a shop editor role:
- In AdminCentral, go to Security > Roles.
- Create a new role such as
sample-shop-editor. This role will be granted permissions to a particular shop. Any groups and users who belong to the role inherit the permission. - Edit the role and go to the Access Control List tab.
- Set the following permissions:
- In
Websiteworkspace, grant permission to the page hierarchy the role should be able to edit. Deny access to any pages they should not be able to edit. This controls whether the shop pages are editable in AdminCentral. - In
Configworkspace, grant permission to the shop menu and its sub nodes such as/modules/adminInterface/config/menu/sampleShop. This allows the role to see the menu in AdminCentral and click items in it. - In
Dataworkspace, grant permission to relevantshops,shopCarts,shopProductsandshopProductCategories. You can for example use the open/close strategy where you first deny access to all shops, then grant specific access to a particular shop. This allows the role to edit the data items such as products and currencies. - Click Save.
Assign editor role to a user
Assigning the role to a user grants that user permission to the controlled resources:
- Go to Security > Users.
- Edit a user.
- In Roles, assign the user to the role you just created.
- Click Save.
Website workspace.
Integration
Payment gateways
The Shop module does not have payment processing. Integrating with a payment gateway is a customization task for the implementer. It can be achieved by:
- Sending client details and total amount to a page on the gateway site. Drawback of this approach is that the user will see that he is redirected to another site.
- Creating a form processor that talks to the selected payment gateway API.