Skip to content

B2B catalog mode

Catalog mode turns the store into a catalog without the ability to purchase. Hide prices, replace buttons with messages or redirect to a quote request. Designed for B2B stores with individual pricing.

Go to WooCommerce > Settings > Polski PRO > Catalog mode and enable the module (option polski_catalog).

SettingDatabase optionDefault valueDescription
Enable catalog modepolski_catalogNoActivates catalog mode
Hide pricespolski_catalog_hide_pricesYesRemoves price display
Hide cart buttonpolski_catalog_hide_cartYesRemoves the “Add to cart” button
Price replacement textpolski_catalog_price_text”Zapytaj o cenę”Text displayed instead of the price
Product noticepolski_catalog_notice""Notice displayed on the product page
Redirect to RFQpolski_catalog_redirect_rfqNoRedirects to the quote request form
Conditional modepolski_catalog_conditionalallall, guests, roles

Catalog mode can be active:

  • For everyone (all) - everyone sees a catalog without prices
  • Only for guests (guests) - logged-in customers see prices and can purchase
  • For selected roles (roles) - catalog active only for selected WordPress roles

The “Only for guests” conditional mode is popular in B2B models where the wholesaler requires account registration before revealing prices.

// Przykład: własna logika warunkowa
add_filter('polski_pro/catalog/is_active', function (bool $is_active): bool {
// Wyłącz tryb katalogowy dla klientów z co najmniej 5 zamówieniami
if (is_user_logged_in()) {
$order_count = wc_get_customer_order_count(get_current_user_id());
if ($order_count >= 5) {
return false;
}
}
return $is_active;
});

The module hooks into the woocommerce_get_price_html filter and replaces the price HTML with the configured replacement text.

/**
* Filtruje tekst zastępczy ceny w trybie katalogowym.
*
* @param string $replacement Tekst zastępczy
* @param \WC_Product $product Obiekt produktu
*/
apply_filters('polski_pro/catalog/price_replacement', string $replacement, \WC_Product $product): string;

Example - different text for categories:

add_filter('polski_pro/catalog/price_replacement', function (string $replacement, \WC_Product $product): string {
if (has_term('premium', 'product_cat', $product->get_id())) {
return '<span class="price-inquiry">Cena ustalana indywidualnie</span>';
}
return $replacement;
}, 10, 2);

The module uses the woocommerce_is_purchasable filter to block the ability to purchase:

/**
* Filtruje, czy produkt jest dostępny do zakupu w trybie katalogowym.
*
* @param bool $purchasable Czy produkt jest dostępny do zakupu
* @param \WC_Product $product Obiekt produktu
*/
apply_filters('polski_pro/catalog/is_purchasable', bool $purchasable, \WC_Product $product): bool;

Example - allowing purchase of selected products:

add_filter('polski_pro/catalog/is_purchasable', function (bool $purchasable, \WC_Product $product): bool {
$always_purchasable = [101, 102, 103]; // ID produktów zawsze dostępnych
if (in_array($product->get_id(), $always_purchasable, true)) {
return true;
}
return $purchasable;
}, 10, 2);

When the polski_catalog_notice option is set, a notice is displayed on the single product page informing the customer about catalog mode.

Example notice:

To learn the price of this product, contact our sales team or fill out the quote request form.

When the polski_catalog_redirect_rfq option is enabled, the replacement button on the product page directs to the quote request form (RFQ module). The integration includes:

  1. “Ask for price” button instead of “Add to cart”
  2. Automatic passing of product ID to the RFQ form
  3. Pre-filling the product name in the form
  4. Return to the product after submitting the request

For the integration to work, both modules - catalog and RFQ - must be active.

Besides prices and the cart button, the module automatically hides:

ElementWooCommerce hookEffect
”Add to cart” buttonwoocommerce_is_purchasableProduct marked as not purchasable
Pricewoocommerce_get_price_htmlPrice HTML replaced with text
Cart icon in headerpolski_pro/catalog/hide_cart_iconHides the mini-cart icon
Cart pagetemplate_redirectRedirect from /cart/ to the homepage
Checkout pagetemplate_redirectRedirect from /checkout/ to the homepage

Not all elements need to be hidden at once. Each option can be enabled or disabled independently. For example:

  • Hide prices but keep the cart button (customer buys at “unknown price” - contact after order)
  • Hide the cart button but show prices (customer sees prices but must ask to purchase)
  • Hide everything (full catalog mode)

Selected products can be excluded from catalog mode in the product editor, Polski PRO > Catalog mode tab, by checking the “Exclude from catalog mode” option.

/**
* Filtruje kategorie wykluczone z trybu katalogowego.
*
* @param array $excluded_categories Tablica ID kategorii
*/
apply_filters('polski_pro/catalog/excluded_categories', array $excluded_categories): array;

Example:

add_filter('polski_pro/catalog/excluded_categories', function (array $excluded_categories): array {
$excluded_categories[] = 15; // "Akcesoria" - zawsze dostępne do zakupu
$excluded_categories[] = 28; // "Outlet"
return $excluded_categories;
});

The module adds CSS classes to <body> to facilitate styling:

ClassWhen added
polski-catalog-modeCatalog mode is active
polski-catalog-prices-hiddenPrices are hidden
polski-catalog-cart-hiddenCart button is hidden

CSS example:

.polski-catalog-mode .price {
display: none; /* Dodatkowe ukrycie ceny, jeśli motyw nie respektuje filtra */
}
.polski-catalog-mode .single_add_to_cart_button {
background-color: #0073aa;
content: "Zapytaj o cenę";
}

Prices still display despite catalog mode being enabled Some themes use non-standard methods to display prices, bypassing the woocommerce_get_price_html filter. Use the CSS classes .polski-catalog-prices-hidden .price { display: none; } as a safeguard.

Customer can add product to cart via direct URL The module blocks this at the woocommerce_is_purchasable filter level. If the issue persists, check whether another plugin is overriding this filter with a higher priority.

Conditional mode does not work properly with cache Caching plugins may serve the cached version regardless of the login state. Configure the caching plugin to separate cache for logged-in and guest users.

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.