Gatemi Catalog Mode Developer Reference

The free edition applies no filters or actions of its own. The filters and actions below are the full edition's.

Filters — Full edition

gmcm_applies

apply_filters( 'gmcm_applies', bool $applies, WC_Product $product ) — whether catalog mode applies to this product, for this visitor, after the settings and the product's own override are taken into account. Every check uses it — the button, the price, purchasability, add-to-cart validation and the cart sweep — so one change here changes all of them together.

$product may be a variation; the settings decision is made on its parent.

// Sell everything to visitors from the trade portal's referral link.
add_filter( 'gmcm_applies', function ( $applies, $product ) {
	return ( isset( $_COOKIE['trade_portal'] ) ) ? false : $applies;
}, 10, 2 );

The decision is not cached, so a filter that reads the current user or request is safe.

gmcm_settings

apply_filters( 'gmcm_settings', array $settings ) — the merged settings array (enabled, hide_price, roles, categories, button_label, button_url, price_text).

gmcm_modules, gmcm_license_api_url, gmcm_update_cache_ttl

The booted module list; the gatemi.com licensing endpoint (for staging mirrors); the update payload's cache lifetime in seconds.

Actions — Full edition

  • gmcm_booted — do_action( 'gmcm_booted', Container $container ) after every module has booted.

Storage

What Where Edition
Settings option gmcm_settings both (free reads enabled, hide_price, button_label, price_text)
Licence option gmcm_license, transient gmcm_update_payload full
Per-product override post meta _gmcm_mode = catalog or sellable; absent = follow the store full

No database tables, no order meta.

WooCommerce hooks used

Hook Purpose
woocommerce_is_purchasable, woocommerce_variation_is_purchasable Return false in catalog mode
woocommerce_add_to_cart_validation Refuse with an error notice
woocommerce_check_cart_items Remove catalog products from a cart
woocommerce_get_price_html (priority 100) Replace the price when hidden
woocommerce_loop_add_to_cart_link (priority 100) Replace the loop button
woocommerce_single_product_summary (priority 1) Removes woocommerce_template_single_add_to_cart at 30 and prints the replacement there
render_block_woocommerce/add-to-cart-form, render_block_woocommerce/add-to-cart-with-options On block themes, replace the Add to Cart block's output with the same replacement
woocommerce_structured_data_product Remove offers when prices are hidden
woocommerce_product_options_general_product_data Full edition: the Catalog mode field

The purchasability and cart hooks run everywhere, the display hooks only on the storefront.

With Where it goes set, the replacement is:

<a href="https://example.com/contact/?gmcm_product=123" class="button gmcm-button">Contact us about this product</a>

For a mailto: address the product name is the subject parameter instead. Read gmcm_product in your form to pre-fill which product the enquiry is about.

CSS classes

Class Edition Element
.gmcmf-notice Free The plain-text replacement
.gmcm-notice Full The plain-text replacement (no address set)
.gmcm-button Full The enquiry button (also .button)

The stylesheet (gmcmf / gmcm) is loaded only on WooCommerce pages (is_woocommerce()), and only sets margins: an empty In place of the button prints no element at all.

Next

Shopping Cart
Scroll to Top