Symptoms
- A shopper signs in, types at least three characters into the header search box, and the Quick Search dropdown shows product cards with "Log in for pricing" instead of a price.
- The same products show the correct price on the full search results page, the category page or the product page.
- Guests see "Log in for pricing" everywhere, which is expected when prices are hidden from guests.
- The problem shows up only when prices are hidden from guests, and only on themes whose Quick Search template is older than, or customized away from, current Cornerstone.
Cause
Quick Search does not reload the page. Cornerstone's quick search script waits until the shopper has typed at least three characters and paused, then asks the storefront to render the search/quick-results template and drops that HTML into the dropdown. That template loops over the results and includes the shared product card partial once per product.
The card decides whether to show a price by checking for the customer object or whether prices are hidden from guests. If the Quick Search template does not pass customer into the card, the card behaves as if nobody is signed in and prints "Log in for pricing".
Cornerstone fixed this in version 2.2.0 (June 2018), change #1272, by adding customer=../customer to the card include in templates/components/search/quick-results.html. The changelog entry describes the price display option at that time as "Restrict to Login". Current Cornerstone also passes settings=../settings, because the card now reads the store setting settings.hide_price_from_guests. A theme can still show the bug today if:
- It is based on a Cornerstone release older than 2.2.0.
- It is a fork where someone replaced or edited
quick-results.htmland droppedcustomer=../customerorsettings=../settings. - It uses a custom search partial or a search app that renders its own cards without the customer context.
Resolution
Work on a copy of the theme, never directly on the live one.
- Confirm the setting. In the control panel, go to Settings > Display and check Hide Product's Price from Guests. On a multi-storefront store this is managed per storefront under Channels > Channel Manager, in that storefront's settings, so check the storefront where the problem occurs. BigCommerce notes that when this is on, guests cannot create a cart and prices are not indexed by search engines.
- Check your theme version. In Storefront > Themes, note the theme name and version. If it is Cornerstone or a theme built on it, compare it with the Cornerstone changelog. Anything at 2.2.0 or later includes #1272, but a customized fork may have lost it.
- Inspect the Quick Search template. Download the theme or open it in your local Stencil project and open
templates/components/search/quick-results.html. Find the{{> components/products/card ...}}include and confirm it contains bothcustomer=../customerandsettings=../settings, alongsidetheme_settings=../theme_settings. - Add the missing parameters. If either is missing, add it to the card include exactly as current Cornerstone does. Leave the rest of your customizations alone. If your theme uses a different card partial for Quick Search, apply the same change there.
- Check the card partial. Open
templates/components/products/card.htmland confirm the price block is wrapped in a check forcustomeror the guest setting. Current Cornerstone uses{{#or customer (unless settings.hide_price_from_guests)}}. If your fork uses a different condition, align it with that check so the card follows the store setting. - Test locally. Run
stencil start, sign in as a test customer, and append?debug=contextto a storefront URL. BigCommerce's Stencil context docs describe this as a way to dump the context as JSON and confirm whethercustomeris present. - Upload and apply the corrected theme as a new version, so you can roll back if needed.
- Verify. In a private browser window, search as a guest and confirm Quick Search shows "Log in for pricing". Then sign in as a customer and confirm Quick Search, the search results page and the product page all show the same price.
If the template already passes both parameters and prices still do not appear, note the theme version, the exact search term and a screenshot, then contact your theme developer or BigCommerce support.
How to prevent it
- Keep a list of every file you have changed in a forked theme, and diff those files against each new Cornerstone release before you merge.
- Retest Quick Search signed in and signed out whenever you change price visibility settings, upgrade the theme or add a search app.
- Cornerstone 6.1.2 (#2131) also stopped exposing hidden prices to guests in
aria-labelanddata-product-priceattributes. If your fork predates that, guests may be able to read prices in the page source.
B2B and ERP considerations
Hidden prices are common on wholesale stores where each customer group or price list has its own pricing synced from the ERP. When this bug hits, buyers often assume their account or price list is broken. Fix the template first, then check pricing separately using A customer sees the wrong contract or group price.
If an integration manages storefront settings, it can read them with GET /v3/settings/storefront/product, which returns hide_price_from_guests. Add channel_id to read a specific storefront's override, as documented in the storefront product settings API.
Related problems to check
- Storefront search misses a partial or formatted SKU
- The filter label is wrong in Cornerstone's Show More dialog
- Stencil start fails with 401 while fetching store channels
Related articles
- The filter label is wrong in Cornerstone’s Show More dialog
- A Stencil widget disappears on account URLs with query strings
- A custom Stencil web-page template does not appear
- A Page Builder widget disappears or only works in preview
- Product rich results fail for a price range or variants
More in the BigCommerce knowledge base, including every article on Domains, themes and storefronts.