Skip to content

Keep wholesale prices and products hidden from retail shoppers

Applies toShopify

Retail and B2B customers can share one Shopify store. SparkLayer only shows B2B prices to signed-in B2B customers, but your products and Shopify prices are visible to everyone until you hide them.

Before you start

  • Your B2B customers tagged b2b in Shopify. See Assign customers to a customer group.
  • A list of B2B-only products, and any that should be retail-only.
  • Someone who can edit your theme code, if you'll hide prices or lock the store. We can explain the approach, but we can't make the changes for you.

Hide what retail shoppers shouldn't see

Choose what to hide

To hideUseHow
Products from retail customers, or from B2B customersB2B Catalogs (steps 2 to 4)Tags in your Shopify admin, no code
Prices from signed-out visitorsLiquid code in your theme (step 5)A developer change
Your whole store until a customer signs inLiquid code in your theme (step 6)A developer change

You can use any of them together. See B2B Catalogs or B2B-only content.

Install and enable B2B Catalogs

Install B2B Catalogs (opens in a new tab) from the Shopify App Store. Open it in your Shopify admin and, under Enable on your theme, choose your theme and click Enable. See Install and enable B2B Catalogs.

Tag your B2B-only products

In your Shopify admin, open each product and add the tag b2b-only, then save. Use b2c-only for products only retail customers should see. Products with neither tag are shown to everyone. See Make a product B2B-only or B2C-only.

A hidden product disappears from product pages, collection pages and store search. If someone opens its URL directly, they see an access denied page, which you can change: see Customise the access denied page.

Hide products from some customer groups

Optional. To show a range to one customer group only, hide its variants from the other groups with the sparklayer.settings variant metafield. This needs the SparkLayer Wholesale app as well as B2B Catalogs, and the products must still be tagged b2b-only. See Catalogs per customer group, and the worked example.

Variant rules only apply to B2B customer groups: they don't hide anything from retail shoppers, and Shopify can't hide a single variant from them. To keep one variant for B2B customers only, make it a separate product and tag it b2b-only.

Hide prices from signed-out visitors

Optional. Ask your developer to add the example code to your product cards and product page. Signed-in B2B customers see the SparkLayer product card, and everyone else sees "Please sign in to see pricing". See Hide prices from signed-out visitors.

Make customers sign in first

Optional, for a store that's only for trade customers. Ask your developer to add the redirect code to theme.liquid. Signed-out visitors go to the login page, except on pages you leave open, such as /pages/b2b-login. See Make customers sign in before they see your store.

Check it worked

  • Signed out, in a private browser window: B2B-only products don't appear in collections or search, opening one's URL shows the access denied page, and prices are hidden if you added that code.
  • Signed in as a B2B customer: you see the B2B-only products with your trade prices, and not the b2c-only ones.
  • Signed in as a customer in another group: products you've hidden from that group don't appear.

If something's not right

  • B2B Catalogs can't change your theme. The theme has invalid Liquid syntax. See Invalid Liquid syntax.
  • A retail shopper sees a B2B-only variant. Variant rules don't apply to retail shoppers. Make the variant a separate b2b-only product. See Variants and retail shoppers.
  • A collection page has gaps, or its counts include hidden products. Hiding happens as the page loads. See Collection grids, search and filter counts.
  • A hidden product is still in someone's cart. Products already in a cart stay there. See Hidden products in a cart.
  • B2B-only products are in your sitemap. Shopify's sitemap still lists them, but search engines can't see the pages. See B2B Catalogs FAQs.
  • Your Shopify prices show in Google. That's standard Shopify behaviour, not SparkLayer. See "How do I stop my Shopify prices showing in Google search results?" in Shopify FAQs.

Next steps

Was this page helpful?

Last updated