Skip to content

B2B catalog mode

Catalog mode turns the store, or chosen products, into a catalog for the visitors you pick: it hides prices, hides the add to cart button and makes products not purchasable, and puts a quote request, a login prompt or your own link in place of the button. It can also close the cart, the checkout and the shop archive. Designed for B2B stores with individual pricing.

Go to Polski > Modules and enable Catalog mode (B2B) (module key catalog_mode). The settings below are the fields on that row; saving the row writes them into the polski_catalog option. The module ships off.

Setting Key Default Description
Applies to audience Logged out visitors only Everyone, Logged out visitors only or Selected user roles
User roles selected_roles empty Comma separated role slugs, used with Selected user roles
Which products availability Only products marked in the product data panel Or All products
Hide prices hide_prices On Replaces the price with the text below
Hide the add to cart button hide_add_to_cart On Also makes the product not purchasable
Replace the button with replacement_mode A quote request A quote request, A login prompt, Your own URL or Nothing
Your own URL custom_url empty Used with Your own URL; with no URL no button is shown
Text shown instead of the price hidden_price_text empty, falls back to “The price is available once you log in or contact us.”
Close the cart page disable_cart Off Sends shoppers from the cart to the home page
Close the checkout page disable_checkout Off The same for the checkout
Close the shop archive disable_shop_archive Off The same for the shop page, product categories and product tags

With Selected user roles, a logged out visitor never sees catalog mode, and a logged in user sees it only with one of the listed roles.

The option holds more keys that are not on the row, all text with a default in the site language when left empty: cta_text (“Ask about trade terms”), login_cta_text (“Log in to see the price”), single_notice, loop_notice (“See trade terms”), the three restriction texts, and the switches show_single_notice, show_single_restriction_text, show_single_cta and show_loop_notice (all on).

With Which products set to Only products marked in the product data panel, catalog mode applies to products with Catalog mode for this product switched on in the Polski Pro tab of the product editor. Since PRO 1.27.0 that tab carries a Catalog mode block: the switch, three-way controls for the price and the add to cart button (follow the global setting, hide, show), and overrides for the message and the button text. They write five product meta keys, _polski_catalog_enabled, _polski_catalog_hide_price, _polski_catalog_hide_cart, _polski_catalog_message and _polski_catalog_cta_text, which is also how you set them from code. A variation with no value of its own falls back to its parent product.

The price and cart controls are three-way rather than checkboxes because any stored value counts as a deliberate override: an unticked box would mean “force it visible”, not “inherit”.

The product message replaces both the text shown instead of the price and the notice on the product page.

  • Price: replaced with <span class="polski-catalog-mode-price"> holding the text shown instead of the price.
  • Product listings: the add to cart button is replaced with the replacement button and the listing notice.
  • Product page: a woocommerce-info box with the notice, a line saying what is hidden, and the replacement button.
  • Purchase: with the button hidden, the product is not purchasable, so it cannot be added to the cart through a direct link either.

In wp-admin prices and purchasability are left alone, so the product list and order screens show real prices.

Mode Button
A quote request Opens the quote request form of the Request a quote module. On the product page it carries that module’s button text. Shown only when the Request a quote module is on and the product can be quoted; otherwise there is no button
A login prompt Links to the My Account page with the login button text
Your own URL Links to the URL you set
Nothing No button

Closing the cart, checkout and shop archive

Section titled “Closing the cart, checkout and shop archive”

Each Close the … switch works on its own. A closed page sends the shopper to the home page with a 302 redirect. Users who can manage WooCommerce are never redirected, so you can still check the store.

The redirect target can be changed with the polski/catalog_mode/disabled_redirect filter. Returning an empty string shows a 404 page instead.

add_filter('polski/catalog_mode/disabled_redirect', function (string $target): string {
return home_url('/contact/');
});

The close switches do not depend on Applies to: they close the pages for every visitor who cannot manage WooCommerce.

Prices still show for logged in customers Applies to is set to Logged out visitors only, the default. Choose Everyone or Selected user roles.

Nothing changes on the storefront Check that the module is on, that Which products is All products or the product has Catalog mode for this product on in its Polski Pro tab, and that the visitor matches Applies to. Before 1.32.6, Everyone and All products did nothing, so update first.

There is no quote button The Request a quote module is off, or the product cannot be quoted under that module’s settings.

Conditional mode does not work properly with cache Caching plugins may serve the same page to logged in and logged out visitors. Configure the cache to keep them apart.

This page is for informational purposes only and does not constitute legal advice. Consult a lawyer before implementation. Polski for WooCommerce is open source software (GPLv2) provided without warranty.