Gatemi Product Discovery Developer Reference

Shortcodes

Shortcode Edition What it places
[gatemi_recently_viewed] Both An empty mount the script fills with the recently viewed row.
[gatemi_compare] Full edition An empty mount the script fills with the comparison table.

wc-ajax endpoints

Called as /?wc-ajax=<action>. All answer JSON and carry no nonce (see How it works).

Free edition Full edition Takes Returns
gmpdf_quick_view gmpd_quick_view product_id html — the panel, or empty.
gmpdf_viewed gmpd_viewed exclude (a product ID to leave out) html — the row, or empty.
gmpdf_track gmpd_track product_id ids — the list after adding.
— gmpd_compare op (list, add, remove, clear), product_id html and the list state, including full.

Free edition

The free edition applies no filters of its own. It runs WooCommerce's woocommerce_single_product_summary action inside the panel.

What Name
Option gmpdf_settings — quick_view, recently_viewed (yes/no)
Cookie gmpdf_viewed — comma-separated product IDs, newest first, 8 at most, 30 days
Script data gmpdfData — quickViewUrl, viewedUrl, trackUrl, productId

Full edition: filters

Filter Arguments What it tunes
gmpd_settings $settings The merged settings.
gmpd_compare_rows $rows The rows of the comparison table.
gmpd_quick_view_hooks array( 'woocommerce_single_product_summary' ) The summary hooks the panel runs, in order.
gmpd_cookie_lifetime 30 * DAY_IN_SECONDS, $cookie_name How long a list is remembered, in seconds.
gmpd_modules $modules The module list booted by the plugin.
gmpd_license_api_url, gmpd_update_cache_ttl — The licence endpoint and the update cache lifetime.

Each row in gmpd_compare_rows is an array of label, callback (given a WC_Product, returns a string) and html (whether the string is markup; when false it is escaped on output). A row without a callable callback is dropped.

// Add a "Weight" row to the comparison table.
add_filter( 'gmpd_compare_rows', function ( $rows ) {
	$rows['weight'] = array(
		'label'    => __( 'Weight', 'my-theme' ),
		'callback' => function ( WC_Product $product ) {
			return $product->get_weight() ? wc_format_weight( $product->get_weight() ) : '';
		},
		'html'     => false,
	);
	return $rows;
} );
// Run a theme's own summary hook in the quick view too.
add_filter( 'gmpd_quick_view_hooks', function ( $hooks ) {
	$hooks[] = 'mytheme_product_summary_extra';
	return $hooks;
} );

Full edition: actions

Action Arguments When
gmpd_booted $container The plugin has finished booting.

Full edition: data

What Name
Option gmpd_settings — quick_view, compare, recently_viewed, quick_view_label, compare_label, compare_limit, viewed_limit, accent
Licence gmpd_license option, gmpd_update_payload transient, gmpd_license_check cron
Cookies gmpd_compare, gmpd_viewed
CSS custom property --gmpd-accent, set on the root element from Accent color

Neither edition creates database tables, post meta or order meta.

CSS classes

Free edition: .gmpdf-buttons, .gmpdf-button, .gmpdf-modal, .gmpdf-modal-box, .gmpdf-modal-close, .gmpdf-quick-view, .gmpdf-quick-view-image, .gmpdf-quick-view-summary, .gmpdf-quick-view-full, .gmpdf-viewed, .gmpdf-viewed-title, .gmpdf-viewed-list, .gmpdf-viewed-item, .gmpdf-viewed-name, .gmpdf-viewed-price.

Full edition: the same names with the gmpd- prefix, plus .gmpd-quick-view-button, .gmpd-compare-button, .gmpd-bar, .gmpd-bar-count, .gmpd-bar-clear, .gmpd-compare, .gmpd-compare-table, .gmpd-compare-row, .gmpd-compare-remove, .gmpd-compare-none and .gmpd-compare-empty.

Shopping Cart
Scroll to Top