Skip to content

Hide products from customers

Applies toShopifyBigCommerceWooCommerceMagento

Steps for

There are 2 places a product can show: in SparkLayer, where B2B customers and sales reps order, and on your store's own pages. You hide it from each in a different way. Most stores only need the first.

Pick the right option

You want toDo thisHidden in
Stop B2B customers seeing or ordering a product, such as a custom product or a feeSet "display": false in the product's sparklayer.settings, as on this pageSparkLayer: Catalog and Quick Order, search in My Cart and SparkLayer's product interfaces
Keep it on show, but stop ordersSet "sell": false insteadNothing hidden: it can't be added to the cart
Show a range to some customer groups onlyHide it for everyone with a base entry, then show it to those groupsSparkLayer, for every other group
Hide products from retail shoppers and signed-out visitorsTag them b2b-only with the free B2B Catalogs app (Shopify)Your store's collection, search and product pages. See Keep wholesale hidden from retail shoppers
Hide a range from some customer groups on your store's pages tooCombine the two: B2B Catalogs and display per customer group (Shopify)SparkLayer and your store's pages. See Catalogs per customer group
What each setting hides, in detail

display and sell are 2 of the product rules per customer group in the sparklayer.settings metafield. They only apply to signed-in B2B customers, and to sales reps ordering for them. Retail shoppers see whatever your theme shows. See What hides what for every view.

Before you start

Hide the products

Turn on the metafield in SparkLayer

Go to Integrations,Platform (opens in your SparkLayer Dashboard in a new tab) and, in the Metafields card, click Configure next to SparkLayer metafields, then enable the product settings metafield. You only do this once.

More detail

On Shopify, SparkLayer adds the sparklayer.settings field to every variant for you. On BigCommerce, WooCommerce and Magento, follow your platform's guide: BigCommerce, WooCommerce or Magento.

Build the setting

Choose who shouldn't see the products and whether to hide them or only stop orders. The form writes the value, which is the same for every product.

Hide products Choose who shouldn't see the products and how. The value is the same for every product.

Hide them from every B2B customer.

The same value goes on every variant you're hiding, in sparklayer.settings
[{"customer_group":"base","display":false,"sell":false}]
In Shopify, open the variant and paste it into Settings under Metafields

Let your AI assistant do it

Connect your Shopify store to your assistant first, such as the Shopify connector in Claude. Then tell it which products in the chat: SKUs, a tag such as CUSTOM, or a collection. It finds every variant, keeps any settings already on them, such as pack sizes, and shows you each change before saving anything.

Ask ClaudeAsk ChatGPT
See the prompt
I use SparkLayer for B2B ordering on my Shopify store. I want to hide some products from my B2B customers in SparkLayer by setting the `sparklayer.settings` metafield on their variants.

How the metafield works: https://docs.sparklayer.io/help/storefront/product-settings.md. Hiding products: https://docs.sparklayer.io/help/guides/hide-products.md.

Use your connection to my Shopify store. If you aren't connected to it, tell me how to connect it to you, then stop.

What I want: Hide them from every B2B customer. Merge this into the `sparklayer.settings` metafield (namespace `sparklayer`, key `settings`, type JSON) on each variant:
[{"customer_group":"base","display":false,"sell":false}]

Do it like this:
1. Ask me which products, if I haven't said yet. I might give you SKUs, a tag (such as every product tagged CUSTOM), a collection or product names.
2. Find every variant of those products and list them in a table: product, variant, SKU and the variant's current `sparklayer.settings` value. Tell me about anything you can't find. Don't change anything yet.
3. Work out each variant's new value. The value is a JSON list with one entry per customer group, and `customer_group` is the group's handle. For each entry above, update that group's entry with the keys shown, or add the entry if the group has none. Keep every other key and entry exactly as it is, such as `pack_size` or `min_order_quantity`.
4. Show me the before and after for each variant, and wait for me to approve.
5. When I approve, save the values as valid JSON with straight double quotes. If my store has no `sparklayer.settings` metafield definition on product variants, create it first (namespace `sparklayer`, key `settings`, type JSON).
6. Then remind me that SparkLayer only reads the metafield once it's turned on in SparkLayer (Integrations > Platform in the SparkLayer Dashboard, in the Metafields card), and that changes can take about 10 minutes to show.
What the values look like

Hide from every B2B customer:

[{ "customer_group": "base", "display": false, "sell": false }]

Hide from the trade and distributors groups only:

[
  { "customer_group": "trade", "display": false, "sell": false },
  { "customer_group": "distributors", "display": false, "sell": false }
]

Show only to the vip group:

[
  { "customer_group": "base", "display": false, "sell": false },
  { "customer_group": "vip", "display": true, "sell": true }
]

Add it to the products

The value goes in the sparklayer.settings field of every variant you're hiding: a product in 3 sizes needs it on all 3. Choose the way that suits how many there are.

How manyHow
A fewOpen each variant in your store's admin, paste the value into its sparklayer.settings field and save. In Shopify, it's Settings under Metafields, as the form shows.
ManyFill in the field for every variant in one table, in your platform's bulk editor.
Many, or found by a tagLet your AI assistant do it. Connect your Shopify store to it, such as with the Shopify connector in Claude, then click Ask Claude or Ask ChatGPT in the form and tell it which products. It finds the variants, shows you every change and only saves them once you approve.

Lots of products? Fill them in one tableShopify

In your Shopify admin, go to Products, tick the products and click Edit products. Click Columns, tick the SparkLayer field under Metafields, then type the values (each variant has its own row) and click Save. Shopify's guide

If the products already have a value

A variant can already have a sparklayer.settings value, such as a pack size for a customer group. Pasting a new value replaces it, so add the display and sell keys to the entries that are there instead. The AI assistant's prompt does this for you: it keeps every other setting.

Hide them from your store's pages too

Optional, on Shopify. To hide the same products from retail shoppers and signed-out visitors, tag them b2b-only with B2B Catalogs: see Keep wholesale hidden from retail shoppers. To hide them from some customer groups on your store's pages as well, see Catalogs per customer group.

Check it worked

Changes take about 10 minutes to sync. Then check as each kind of customer:

Check asWhat you should see
A customer in a group you hid them fromThe products aren't in Catalog and Quick Order or in search in My Cart. With Show it, but stop orders, they show as Unavailable for this account.
A sales rep ordering for that customerThe same as the customer: the rep's Catalog follows the customer's group.
A customer in another groupThe products as usual.

If something's not right

  • A product still shows. Check the value is on every variant, not the product, and that each customer_group is a handle, such as trade, not a Shopify tag, such as b2b-trade. See Why aren't my settings being applied?
  • A pack size or limit stopped working. The new value replaced the variant's old one. Add the old settings back into the same value: see Which rule wins.
  • The product still shows on your store's collection pages. display only changes SparkLayer. Use B2B Catalogs as well: see step 4.
  • The value doesn't save. It must be valid JSON with straight quotes ("). Build it with the form rather than typing it.

Next steps

Was this page helpful?

Last updated