# B2B Catalogs

URL: https://docs.sparklayer.io/help/storefront/b2b-catalogs
Applies to: Shopify

Show or hide Shopify products for B2B and retail customers with tags, using the free B2B Catalogs app. Install it, enable it on a theme and see how it works.

> **Quick summary**
>
> - With [B2B Catalogs](https://apps.shopify.com/sparklayer-b2b-catalogs), B2B and retail (B2C) customers each see only the products meant for them. You choose which with tags in your Shopify admin. No code needed.
> - It's a standalone app, free on every SparkLayer plan, including the free plan. It's only available for Shopify.
> - You turn it on for each theme from the app in your Shopify admin. There's no limit to how many themes you can enable it on.
> - Showing different products or variants to different [customer groups](https://docs.sparklayer.io/help/glossary.md#customer-group) also needs the [SparkLayer Wholesale app](https://docs.sparklayer.io/help/platforms/shopify/install.md). See [Catalogs per customer group](https://docs.sparklayer.io/help/storefront/b2b-catalogs/configuring-advanced-catalogs.md).

## How it works

A product hidden from a customer doesn't show to them on product pages, collection pages or in store search. If a customer opens a hidden product's URL directly, they see an [access denied page](https://docs.sparklayer.io/help/storefront/b2b-catalogs/configuring-access-denied-view.md) instead. Hiding happens as the page loads, so a hidden product can still take a place in a collection grid and count towards product and filter totals: see [Collection grids, search and filter counts](https://docs.sparklayer.io/help/storefront/b2b-catalogs/limitations.md#grids-search-and-filter-counts).

To make this work, B2B Catalogs changes the files of each theme you enable it on, so the theme can check who's browsing.

How a customer's tags decide what they see:

1. **Customer tags**: A customer tagged `b2b` is a B2B customer. Everyone else is a retail (B2C) customer.
2. **Product tags**: `b2b-only` products are shown only to B2B customers. `b2c-only` products are shown only to retail customers.
3. **Customer group rules**: If you need it, the `sparklayer.settings` metafield hides variants from particular B2B customer groups, such as customers tagged `b2b-vip`. It doesn't hide anything from retail customers.
4. **What they see**: Hidden products drop out of product pages, collections and search. A direct link shows the access denied page.

To set up the tags, see [Show or hide products](https://docs.sparklayer.io/help/storefront/b2b-catalogs/configuring-your-catalogs.md).

### B2B Catalogs or B2B-only content

B2B Catalogs hides whole products from B2B or retail customers, and variants from B2B customer groups. It can't hide a single variant from retail customers: see [Variants and retail shoppers](https://docs.sparklayer.io/help/storefront/b2b-catalogs/limitations.md#variants-and-retail-shoppers). To change what B2B customers see in other ways, use one of SparkLayer's other options:

| Option | Use it to | How |
| --- | --- | --- |
| B2B Catalogs | Hide whole products from B2B or retail customers across your store, and variants from B2B customer groups | Tags in your Shopify admin, no code |
| [Shopify B2B-only content](https://docs.sparklayer.io/help/platforms/shopify/customisations/b2b-only-content.md) | Hide prices from signed-out visitors, show B2B-only content, menus and banners, or redirect pages | Liquid code in your theme |
| [How products are shown](https://docs.sparklayer.io/help/storefront/product-display.md) | Change what SparkLayer's product interfaces show signed-in B2B customers, including hiding a variant or stopping it being added to the cart | Settings in your theme's code and the `sparklayer.settings` metafield |

`display: false` in the `sparklayer.settings` metafield on its own only hides a product inside SparkLayer's views, such as search, quick order and the cart. Your theme's collection pages, product pages and featured sections need B2B Catalogs. See [What hides what](https://docs.sparklayer.io/help/storefront/product-settings.md#what-hides-what).

## Install and enable B2B Catalogs

1. Install [B2B Catalogs](https://apps.shopify.com/sparklayer-b2b-catalogs) from the Shopify App Store. The app guides you through setup.
2. Open the app in your Shopify admin. Under **Enable on your theme**, choose a theme from the drop-down and click **Enable**.
3. Tag your customers and products. See [Show or hide products](https://docs.sparklayer.io/help/storefront/b2b-catalogs/configuring-your-catalogs.md).

**More detail**

B2B Catalogs adds a snippet to the theme, `snippets/sparklayer-b2b-catalogs-access-denied.liquid`, which shows the [access denied page](https://docs.sparklayer.io/help/storefront/b2b-catalogs/configuring-access-denied-view.md). If the app can't change a theme because of invalid Liquid syntax, see [B2B Catalogs limitations](https://docs.sparklayer.io/help/storefront/b2b-catalogs/limitations.md#invalid-liquid-syntax).

## Enable or disable it on other themes

Once you've enabled B2B Catalogs on one theme, the app lists all your themes under **Enable on your theme**. Each theme shows its **Type** (**Published** or **Unpublished**) and **Status** (**Enabled** or **Disabled**).

1. Open B2B Catalogs in your Shopify admin.
2. Find the theme and click **Enable** or **Disable** in the **Action** column.

You can enable it on published and unpublished themes, and on as many themes as you like.

**More detail**

Disabling B2B Catalogs on a theme removes its visibility rules from that theme, along with any changes you've made to the access denied page. Before you uninstall the app, disable it on every theme: see [Uninstall B2B Catalogs](https://docs.sparklayer.io/help/storefront/b2b-catalogs/removing-b2b-catalogs.md).

## Troubleshooting

**Diagnose: Product showing to the wrong customers?** Check which tool should hide it.

1. **What’s happening?** Pick the closest match.
   - A product shows to customers who shouldn’t see it: go to question 2
   - A product is hidden from customers who should see it: go to fix A (Check the product itself)
2. **Where do they see it?** SparkLayer’s own views and your theme’s pages are hidden by different tools.
   - In SparkLayer’s quick order, search or cart: go to question 3
   - On collection, product or search pages: go to question 4
   - In a section such as a featured collection: go to question 5
3. **Does the variant’s `sparklayer.settings` metafield set `"display": false` for the customer’s group?** Use the group’s handle, for example `base`. Entries for a group override the `base` entry. Where to look: Products > select a variant > Metafields (Shopify admin).
   - Yes: go to question 6
   - No: go to fix B (Add a rule for that group)
4. **Is the free B2B Catalogs app installed and enabled on your live theme?** The visibility metafield only hides products inside SparkLayer. Hiding them from your theme’s pages needs B2B Catalogs. Where to look: Online Store > Themes (Shopify admin).
   - Yes: go to question 7
   - No / not sure: go to fix C (Install B2B Catalogs and enable it on your live theme)
5. **Is the free B2B Catalogs app installed and enabled on your live theme?** Sections such as featured collections are your theme’s, so only B2B Catalogs can hide products in them. Where to look: Online Store > Themes (Shopify admin).
   - Yes: go to fix D (Turn B2B Catalogs off and on again on your live theme)
   - No / not sure: go to fix C (Install B2B Catalogs and enable it on your live theme)
6. **Is the JSON written with straight quotes and valid formatting?** Curly quotes from a word processor, or a missing comma or bracket, break every rule in the value. Paste it into a JSON checker if unsure.
   - Yes: go to fix E (Everything checks out)
   - No / not sure: go to fix F (Fix the JSON)
7. **Is the product tagged, for example `b2b-only`, or in a catalog for the right groups?** `b2b-only` hides a product from retail shoppers. `b2c-only` hides it from B2B customers. Where to look: Products > select the product (Shopify admin).
   - Yes: go to fix D (Turn B2B Catalogs off and on again on your live theme)
   - No: go to fix G (Tag the product)

**Fixes**

- **A. Check the product itself** A product that should show but doesn’t usually has a SKU, status, sales channel or price list issue. Next: Product missing, no B2B price or “Unavailable”?
- **B. Add a rule for that group** Add an entry for the customer’s group with `"display": false` to the variant’s `sparklayer.settings` metafield. To hide it from every B2B customer, use the `base` group. Where: Products > select a variant > Metafields (Shopify admin). See [Product settings](https://docs.sparklayer.io/help/storefront/product-settings.md).
- **C. Install B2B Catalogs and enable it on your live theme** Without it, tags such as `b2b-only` and the visibility metafield can’t hide products on your theme’s pages. Install the free app, then enable it on your live (published) theme. See [B2B Catalogs](https://docs.sparklayer.io/help/storefront/b2b-catalogs.md).
- **D. Turn B2B Catalogs off and on again on your live theme** After app updates or theme changes, the live theme may not have the latest B2B Catalogs code. Turn it off and on again on the live theme. If the product still shows in a section, send us the page link. See [B2B Catalogs](https://docs.sparklayer.io/help/storefront/b2b-catalogs.md).
- **E. Everything checks out** Your setup looks right, so we'll take it from here. Send us your answers with the product link and the customer’s email.
- **F. Fix the JSON** Retype the quotes as straight quotes, correct the formatting and save. Copy an example from Product settings as a starting point. See [Product settings examples](https://docs.sparklayer.io/help/storefront/product-settings.md).
- **G. Tag the product** Add `b2b-only` to keep it from retail shoppers, or set up a catalog for the groups that should see it. Where: Products > select the product (Shopify admin). See [Catalogs per customer group](https://docs.sparklayer.io/help/storefront/b2b-catalogs/configuring-advanced-catalogs.md).

**Why do b2b-only products show in a featured collection?**

After an app update or a change to your theme, a section such as a featured collection can start showing `b2b-only` products. Open B2B Catalogs, click **Disable** on your live (published) theme, then click **Enable** again. Disabling removes your changes to the [access denied page](https://docs.sparklayer.io/help/storefront/b2b-catalogs/configuring-access-denied-view.md), so keep a copy of them first.

**Why don't my b2b-only and b2c-only tags do anything?**

The tags only work while B2B Catalogs is installed and enabled on your live (published) theme. Enabling it on an unpublished theme doesn't change your live store. Check the theme's **Status** shows **Enabled** under **Enable on your theme**.

**Can I hide a whole collection?**

Not with B2B Catalogs: it hides products, not collections. A third-party Shopify app can restrict who can open a collection's URL.

## Get help

Email [support@sparklayer.io](mailto:support@sparklayer.io), or click the message icon in the B2B Catalogs app. See [Contact support](https://docs.sparklayer.io/help/support.md) for when we're available and what to include.

## Next steps

- [Show or hide products](https://docs.sparklayer.io/help/storefront/b2b-catalogs/configuring-your-catalogs.md): Mark customers as B2B and products as B2B-only or B2C-only with Shopify tags.
- [Catalogs per customer group](https://docs.sparklayer.io/help/storefront/b2b-catalogs/configuring-advanced-catalogs.md): Show or hide variants for particular customer groups with the sparklayer.settings metafield.
- [Customise the access denied page](https://docs.sparklayer.io/help/storefront/b2b-catalogs/configuring-access-denied-view.md): Change what customers see when they open a product that's hidden from them.
- [B2B Catalogs limitations](https://docs.sparklayer.io/help/storefront/b2b-catalogs/limitations.md): Variant limits, carts, permalinks, third-party apps and theme syntax errors.
- [B2B Catalogs FAQs](https://docs.sparklayer.io/help/storefront/b2b-catalogs/faqs.md): SEO and sitemaps, pricing, setup and disabling the app on a theme.
- [Uninstall B2B Catalogs](https://docs.sparklayer.io/help/storefront/b2b-catalogs/removing-b2b-catalogs.md): Disable the app on every theme, then uninstall it safely.
