Shopify Dawn Theme & SparkLayer

Credit: Shopify


Dawn is the first free Online Store 2.0 theme released by Shopify and is the ideal way to start configuring your Shopify store in a best-practice way. When you create a Shopify store for the first time, your store will by default use this theme and you can also use it for your existing Shopify store. You can learn more about the Dawn theme and see it in action here.
To make it easy to get up and running with SparkLayer, we've a B2B optimised version of the Dawn theme that you can download, configure, and then customise. The B2B optimised Dawn theme brings the following features:
Try the demo! You can try our Shopify Dawn demo store here

How it works

The SparkLayer B2B optimised version of Dawn works by adapting specific parts of the Dawn theme, activating the SparkLayer Frontend as well as enabling a special login page. You can see how it works in our video below
The B2B optimisations include:
  • A login page that optionally forces the customer to sign in before accessing the store and allows prospective customers to apply for an account. This content for this page can be customised via the Shopify Customizer
  • Product cards that display on collection pages, showing the customers B2B pricing and the ability to add to an order
  • Product detail page that show the customers B2B pricing and the ability to add to an order
  • My account and cart using the SparkLayer Frontend
  • A Quick Buy mode that lets customers quickly build orders

Using the SparkLayer 1-click install

If you already have a SparkLayer account, you can use our special 1-click install to rapidly add the Shopify B2B Dawn theme to your Shopify store! It's a great way to quickly test how SparkLayer works or even as a starting point for your new B2B tore!
Within the Frontend Configuration section, simply click the 'Use our demo B2B theme' button to get started.

How it works

The Demo B2B theme works by automatically connecting to your Shopify Store and adding a brand new theme to your 'Theme library' within Shopify. The theme comes 'pre-loaded' with all your SparkLayer settings meaning there are no code changes for you to make!
Once the theme is added, you can then edit and preview it just as you would any other Shopify theme. Within the theme code itself, the installation process automatically adds all the SparkLayer code for you such as the SparkLayer Core Script and all the product page widgets, making it really quick to get up and running.
Please note the following:
  • The installation process will add all the necessary theme code for you; you'll then need to add your B2B pricing and customer groups to complete the testing process.
  • If you wish to remove the B2B theme, this works as with any other Shopify theme and can be easily deleted from within Shopify
  • Shopify has a limit of 20 themes for some Shopify plans, you'll be notified if you need to remove an existing theme to complete the installation process.
  • Each time you click the Install button, this will create a new B2B theme within your Shopify store

Manually installing the Dawn B2B theme

To get started, you'll first need to install the Dawn theme on your Shopify store and then action a number of specific code changes. There are three ways to go about implementing the code snippets:
  1. 1.
    Download our code samples and simply replace the matching files within your Shopify theme: ideal if you've made no changes so far to your Dawn theme.
  2. 2.
    Download the full repository via Github here and then uploading as a new theme in your Shopify store.
  3. 3.
    Review our code samples and manually apply them to your theme files: the best option if you've already made customisations to your Dawn theme.
Installing the code snippets involves adjusting (or adding) the following files and we've included direct links to Github to see the code.
File Name
Code sample
The code theme file where the SparkLayer core script is installed along with a number of other customisations for CSS and forced login. You'll need to add the SparkLayer core script to complete set up
A new file that creates a B2B login page (see guide below)
A new file that creates the content for the B2B login page
The product detail page with SparkLayer enabled
The product card with SparkLayer enabled
An updated registration page that is required if using the forced login page
Using Github? Click here the full Dawn Github repository with changes for SparkLayer

Creating the login page

Important! If you're wanting to set up a forced login page, please ensure a new page is created in Shopify as detailed below.
You can optionally force all customers to login before they begin browsing your store and adding products to their B2B order.

Setting up a new login page

To enable this page, you'll need to create a Page within Shopify and then assign this page a special template.
  1. 1.
    First, add the templates/ (download here) and sections/trade-login.liquid (download here) files to your theme, ensuring each file goes into the correct directory.
  2. 2.
    Within your Shopify admin, under Online Store, click Pages, and then click the Add page button at the top
  3. 3.
    Give the page a title and then under Edit website SEO at the bottom, ensure the URL and handle is set to trade-login
  4. 4.
    Finally, under Online store and Theme template, choose trade-login
Once you've saved the page, you can then visit to see the login page.

Using a contact form to apply for an account

The login page allows prospective customers to apply for an account and is set up to use the built in Shopify contact form to trigger an email.
When a customer fills in this form, an email will automatically be sent to the Shopify store's email address and include any additional fields you've added.
Adding custom fields is simple, and you can customise the fields exactly as you need. To add new fields, simply include a new code snippet within the /sections/trade-login.liquid file, making sure to adjust the names and id accordingly. In our example below, this is set up to capture a Company name.
<div class="field">
<input class="field__input" autocomplete="name" type="text" id="ContactForm-company" name="contact[Company]" placeholder="Company">
<label class="field__label" for="ContactForm-company">Company</label>

Using a custom contact form

If you'd prefer to use a custom form to manage applications to your B2B store rather than the Shopify contact form, you can enable this via the Customizer. When in edit mode, simply tick the below box and then paste in your contact form HTML code. Alternatively, you can adjust this directly within the /sections/trade-login.liquid file.

Enabling the forced login page

If you'd rather force customers to login before seeing your store, you can easily adjust this within the layout/theme.liquid file.
To enable the forced login page, simply change the following code to true.
{% assign showSiteForB2B = true %}
{% endif %}
{%- if showSiteForB2B == blank -%}
{% assign showB2BLogin = true %}
{% endif %}

Hiding prices by default

If you want to hide prices until a customer is signed in, you can enable a special setting that will hide prices on product collection and product detail pages.
To enable the hiding of prices, simply set hidePricesLoggedOut to true in the following files:
  • /snippets/card-product.liquid
  • /sections/main-product.liquid
Within the above files, you can also adjust the text and styling that is show to the logged out customer.

Customising the design

Nearly all elements of the login page can be customised via the standard Shopify customisation tools. When you're in the Customize mode, navigate to the login page and you'll see all available content that can be modified.

Modifying theme.liquid

In order to enable the SparkLayer Frontend and customise your storefront to have a login screen, you'll need to update the /layout/theme.liquid file. You can use our code sample here to get started and see the exact file location here.
Please note, you'll still need to add the SparkLayer Core Script to this file. Learn more here

B2B only products

The B2B optimised Dawn theme also has support for B2B only products. This is a great way to hide specific products from logged out customers and it's easy to configure within Shopify.
The feature works by automatically hiding any products that you have tagged with the specific tag b2b-only from within the Shopify Products admin.
When you tag a product with b2b-only, this product will be invisible to all logged-out customers and won't show on any of your collections pages. If you need to customise this feature, you can edit how it works in the following files:
File Name
Code sample
The homepage featured collection
The main product collection page
The quick search feature that shows products
The main product detail page

Quick Buy Mode

The B2B optimised Dawn theme also has support for 'quick buy mode' that allows you to display product collection pages in a more streamlined view for your B2B customers. Once enabled, your collection pages will be displayed similar to below with pricing, variant options, product rules (e.g. pack sizing) and the ability to quickly add items to an order.
Try the demo: Visit our Demo site and click Quick Buy once logged in
To enable 'quick buy mode', within Shopify, go to Products and click Collections and then edit the collection page you wish to apply this to. From the Theme template section, simply choose quick buy from the list of options and click save.
It's also possible to apply the 'quick buy mode' to all collection pages if you'd prefer. To enable this, open the file /templates/collection.json and adjust the code as shown below.
"product-grid": {
"type": "main-collection-product-quick-buy",
From an implementation point of view, the 'quick buy mode' enables a special template view, managed within the following files:
  • /sections/main-collection-product-quick-buy.liquid
  • /snippets/card-product-quick-buy.liquid
It's also possible to adjust the styling of the 'quick buy mode'. Simple open /sections/main-collection-product-quick-buy.liquid and edit the CSS displayed at the top.
Important to note: if you apply the new 'quick buy mode' to your collection pages, this will also take effect for logged-out customers also. If you are looking to customise the behaviour of how this works, we recommend engaging a Shopify expert to assist.

Sample products and price lists

If you're starting your B2B store on Shopify from scratch, you can even install our sample B2B products to populate your product catalogue and price lists in SparkLayer. You can see these in action on our demo store
This is a great way to see how SparkLayer works on your Shopify store before then configuring it with your own products.
Download CSV
Shopify sample products
Upload CSV via the Products admin in Shopify
SparkLayer sample B2B pricing
Upload CSV via the Price Lists admin in the SparkLayer Dashboard

Additional information

  • The Dawn theme is maintained and built by Shopify and may be subject to periodic updates inline with their own releases.
  • Installing our code snippets does require moderate technical experience in how Shopify themes work and you may want to ask a Shopify expert to assist.