B2B Dawn theme
Applies toShopify
How it works
Use the B2B Dawn theme if you'd rather start from a theme that's ready for B2B than change your existing one. Dawn (opens in a new tab) is Shopify's free Online Store 2.0 theme, and the default theme for new Shopify stores. To learn more about it, read Shopify's guide to the Dawn theme (opens in a new tab).
Our B2B version adapts parts of Dawn to turn on the SparkLayer frontend interfaces and add a B2B login page. It includes:
- A B2B login page that can force customers to sign in before they see your store, and lets prospective customers apply for an account. You edit its content in the Shopify theme editor.
- The product card interface on collection pages, showing B2B prices with the option to add to an order.
- The product detail interface, showing B2B prices with the option to add to an order.
- The My Account and My Cart interfaces.
- Quick Buy mode, a compact collection page layout for building orders quickly.
Dawn is built and maintained by Shopify, so it may change with Shopify's own releases.
Install the B2B Dawn theme
You need Dawn installed on your Shopify store. Then choose one of these options:
| Option | How | Best for |
|---|---|---|
| Download the full theme | Download it from GitHub (opens in a new tab) and upload it as a new theme (opens in a new tab). | A new store: the quickest option |
| Download our code samples | Replace the matching files in your Dawn theme. | A Dawn theme you haven't changed yet |
| Review our code samples | Apply the changes to your theme files by hand. | A Dawn theme you've already customised |
Downloading the full theme needs no coding. The other 2 options mean editing your theme's code files. So do most of the settings further down this page: forced sign-in, hidden prices, the B2B-only menu and Quick Buy on every collection. If you don't edit theme code yourself, pass this page to your developer, or contact our support team for help.
These are the files that change, with links to the code on GitHub. The full theme is in the SparkLayer Dawn repository (opens in a new tab).
| File | What it does | Code |
|---|---|---|
layout/theme.liquid | The main theme file. It loads the SparkLayer Core Script and adds other changes for CSS and forced login. Follow the frontend integration guide to finish setting it up. | theme.liquid (opens in a new tab) |
templates/page.b2b-login.json | New file. The template for the B2B login page. | page.b2b-login.json (opens in a new tab) |
sections/main-b2b-login.liquid | New file. The content of the B2B login page. | main-b2b-login.liquid (opens in a new tab) |
sections/main-product.liquid | The product page, with SparkLayer turned on. | main-product.liquid (opens in a new tab) |
snippets/card-product.liquid | The product card, with SparkLayer turned on. | card-product.liquid (opens in a new tab) |
templates/customers/register.liquid | An updated registration page, needed if you use the forced login page. | register.liquid (opens in a new tab) |
To see the theme as a B2B buyer before you publish it, choose it in Try it out and place a test order. When you publish it, step 5 of
SparkLayer Wholesale,Setup (in your Shopify admin), Publish theme, ticks itself off.
Create the B2B login page
To use the B2B login page, and to force customers to sign in, create a Shopify page that uses the b2b-login template. The page has a sign-in form, a section inviting prospective customers to apply for an account, and an optional set of questions and answers.
- Add
sections/main-b2b-login.liquid(opens in a new tab) andtemplates/page.b2b-login.json(opens in a new tab) to your theme, each in the right folder. - In your Shopify admin, go to Online Store,Pages (opens in your Shopify admin in a new tab) and click Add page.
- Give the page a title. Under Edit website SEO, set the URL and handle to
b2b-login. - Under Online store, set Theme template to
b2b-login, then save. - Visit
www.yourstore.com/pages/b2b-loginto see the new page.
To change how applications work, see Shopify B2B registration and login.
Customise the login page
You can change nearly every part of the login page in Shopify's theme editor, including colours, form fields and text.
- Go to Online Store,Themes (opens in your Shopify admin in a new tab) and click Customize.
- Open the
b2b-loginpage from the page selector at the top. - Select the Login Page section. Its settings include the Background Image, Title, Introduction Text, Open Account Title, Open Account Text and Open Account Button Title. Add FAQs blocks to build the questions and answers.
Force customers to sign in
To make every customer sign in before they can see your store, first create the B2B login page. Then edit layout/theme.liquid and set this code to true:
{% raw %}
{% assign showSiteForB2B = true %}
{% endif %}
{%- if showSiteForB2B == blank -%}
{% assign showB2BLogin = true %}
{% endif %}
{% endraw %}Hide prices until customers sign in
You can hide prices on collection and product pages until a B2B customer signs in. Signed-out visitors see a message such as "Please sign in to see pricing" instead.
Set hidePricesLoggedOut to true in these files:
/snippets/card-product.liquid/sections/main-product.liquid
In the same files, you can change the text and styling that signed-out visitors see.
Show products only to B2B customers
The theme can hide chosen products from signed-out visitors. In your Shopify admin, open a product and add the tag b2b-only in its Tags field. The product then disappears from your collection pages for everyone who isn't signed in.
To change how this works, edit these files:
| File | What it controls | Code |
|---|---|---|
sections/featured-collection.liquid | The featured collection on the homepage | featured-collection.liquid (opens in a new tab) |
sections/main-collection-grid.liquid | The main collection page | main-collection-product-grid.liquid (opens in a new tab) |
sections/predictive-search.liquid | Products shown in the quick search | predictive-search.liquid (opens in a new tab) |
sections/main-product.liquid | The product page | main-product.liquid (opens in a new tab) |
Show a B2B-only menu
The theme can show B2B customers a different navigation menu from signed-out (retail) visitors.
- In your Shopify admin, go to Online Store,Navigation (opens in your Shopify admin in a new tab) and create a menu.
- Add your menu items. Under Handle, enter
b2b-menu, then click Save menu. - In these files, set
showB2BNavtotrue:snippets/header-mega-menu.liquidsnippets/header-dropdown-menu.liquidsnippets/header-drawer.liquid
{% assign showB2BNav = true %}To test it, sign in as a B2B customer and check the menu.
Use Quick Buy mode
Quick Buy mode shows a collection as a compact list, so buyers can build orders quickly. Each product has its B2B price and RRP, quantity price breaks, variant drop-downs, quantity controls with any product rules (such as pack sizes) and an Add button. To try it, sign in to our demo store (opens in a new tab) and open the Quick Buy collection (opens in a new tab).
To use it on one collection:
- In your Shopify admin, go to Products,Collections (opens in your Shopify admin in a new tab) and open the collection.
- Under Online Store, set Theme template to
quick-buy, then save.
To use it on every collection, open /templates/collection.json and change the product grid section's type:
"product-grid": {
"type": "main-collection-product-quick-buy",Quick Buy mode uses its own template files:
/sections/main-collection-product-quick-buy.liquid(opens in a new tab)/snippets/card-product-quick-buy.liquid(opens in a new tab)
To change its styling, edit the CSS at the top of /sections/main-collection-product-quick-buy.liquid.
Quick Buy mode also applies to signed-out visitors on the collections where you use it. To change that, we recommend working with a Shopify expert.
Add sample products and prices
If you're starting a B2B store from scratch, load our sample B2B products and prices to see how SparkLayer works before you add your own. You can see them on our demo store (opens in a new tab).
| Item | How to import it | Download |
|---|---|---|
| Shopify sample products | Upload the CSV in your Shopify admin under Products | Sample products CSV (opens in a new tab) |
| SparkLayer sample B2B prices | Upload the CSV in | Sample B2B prices CSV (opens in a new tab) |
| SparkLayer sample metafields | Upload the CSV with a third-party app such as Metafields Guru (opens in a new tab) | Not available |
FAQs
Google indexes most Shopify stores, so your Shopify (retail) prices may appear in its search results. This is standard Shopify behaviour, not something SparkLayer controls.
To stop it, you need to customise your Shopify store itself. Shopify Support can advise, and there are Shopify community articles (opens in a new tab) on the topic. Changes like this can affect your search rankings, so speak to a Shopify expert first.
Last updated