There are several options when it comes to ecommerce for Umbraco, from plugins through to enterprise level solutions (and their hefty yearly price tags).
Some are easy to set up, whilst others require a degree in software engineering to implement :) .
The following steps explain how to add ecommerce to an Umbraco website:
Step 1 involves adding two simple links to your site's main template, often called the Layout or Master Template. The image below shows a typical example.
Add this line of code just before the </head> tag in your template (for css styling):
Step 2 to adding ecommerce to your website involves the addition of simple basket, checkout and order placed pages within the Umbraco back-office.
The best approach is to use a series of nested pages that guide users through placing an order. A typical basket and checkout URL structure looks like this:
/basket
/basket/checkout
/basket/checkout/ordered
Cartbraco doesn't enforce this structure, you are in full control, but we find this approach generally works the best.
Add Checkout Widgets to Your Umbraco HTML Pages
Step 3: If you are using Cartbraco, add widgets to your three new pages to instantly create a basket and checkout experience in your Umbraco store. Simply insert the following lines of code into the relevant page's HTML template:
Product Page Add to Basket Buttons for Umbraco Ecommerce
Step 4 - include Add to Basket buttons within your product pages.
With an e-commerce plugin like Cartbraco, you can use two widget styles: Single or Multi Add to Basket. The clue here is in the widget name, the Single option adds a simple button that when clicked will add your choice of sku to the visitors basket. The Multi option adds a component to the page allowing users to select the relevant sku, adjust quantities and the all important Add to Basket button.
With Cartbraco, each button style can accept a range of parameters the dictate the quantity added to basket together with other, optional theme related settings.
Single Add to Basket Button
Required: sku
Optional: quantity to add, text, fore and background colours and an icon url
Include code:
@await Component.InvokeAsync("CartbracoSimpleAddToBasketBtnVC", new { sku = "yoursku1", qty = 1.0, text = "Add to Basket", fg = "#ffffff", bg = "#f0235e" })
Multi Add to Basket Buttons
Required: skus, comma separated
Optional: text, fore and background colours and an icon url
Include code:
@await Component.InvokeAsync("CartbracoMultiAddToBasketBtnsVC", new { skus = new[] { "yourparentsku" }, text = "test", fg = "#ffffff", bg = "#f0235e" })
Configure Ecommerce in the Umbraco Back Office
The final step when including any ecommerce plugin to your Umbraco website is to configure settings such as style, webhooks, tax, currency etc.
In this example we are using the Cartbraco Umbraco 13 store plugin, so log into the back-office and head to the Cartbraco section, followed by the Config tab:
The tab's contents are split into 9 sub-groups:
Core Urls - Your website domain, basket, checkout and Ordered page urls.
Order Tracking - A url template for an order tracking link on order confirmations.
Webhooks - Optional url endpoints to send basket data on order placement and amends (useful for 3rd party system integrations).
Default Shipping Restrictions - Set global Zip or Country restrictions for your goods and services.
Tax, Rounding and Currency - Default settings such as rounding, decimal places, tax factors etc.
CSS, HTML - Customisable HTML elements for order confirmations, terms etc, and the option to apply your own custom CSS styling.
Payment Gateway - Select your Payment Gateway of choice (Cartbraco ships with 2 Stripe payment gateway options - Embeded or Hosted).
Company Information - Set your companies Invoice Address, methods of contact etc for inclusion on Order confirmations.
Order Confirmation - Choose if and when to send an Order confirmation email to your customer, and at what status i.e. Placed, Shipped, Delivered.
Cartbraco allows you to adjust your Umbraco ecommerce store's theme, including field labels, button colours, icons, your business logo etc. Click on the Theme tab to reveal the theming options available to you.
N.B. These are deliberately kept to a minimum with the intention of the widgets inheriting your own site's style.
Free Umbraco Ecommerce Demo?
With your Umbraco website now a fully fledged online store, the only thing left to to is get selling!