Gatemi Request a Quote Developer Reference

Shared between the editions

Item Name
Quotes table {prefix}gmrq_quotes — id, token (unique), status, customer_id, name, email, phone, company, message, reply, total (lines plus delivery), shipping_total, shipping_label, order_id, expires_at, quoted_at, created_at
Lines table {prefix}gmrq_quote_items — id, quote_id, product_id, variation_id, quantity, price
Settings option gmrq_settings
Per-product switch post meta _gmrq_mode — quote, sell, or absent
Quote list cookie gmrq_basket — product:0:quantity entries joined by `
Shortcode [gatemi_quote_basket] — the quote list and request form
Form nonce action gmrq_action, field _wpnonce

Statuses: pending (asked), quoted, accepted, declined. The free edition only ever writes pending.

Form actions

POSTs handled on template_redirect at priority 5. The gmrq_action field says which:

gmrq_action Fields
add product_id, quantity
set_quantity product_id, quantity (0 removes)
remove product_id
submit gmrq_name, gmrq_email, gmrq_phone, gmrq_company, gmrq_message
accept, decline gmrq_token — Full edition

add, set_quantity and remove redirect back to the page they came from.

WooCommerce hooks used

woocommerce_is_purchasable, woocommerce_variation_is_purchasable, woocommerce_add_to_cart_validation, woocommerce_check_cart_items (the enforcement, also in the admin), woocommerce_loop_add_to_cart_link (priority 100, the shop-loop button) and woocommerce_single_product_summary (swaps woocommerce_template_single_add_to_cart at 30 for the quote form). On block themes, render_block_woocommerce/add-to-cart-form and render_block_woocommerce/add-to-cart-with-options replace those blocks' output with the quote form for a quote-only product (both editions).

CSS classes

Product and loop: .gmrq-add, .gmrq-qty, .gmrq-button (also button; in the free edition also wp-element-button), .gmrq-added. Quote list: .gmrq-basket, .gmrq-notice, .gmrq-empty, .gmrq-lines, .gmrq-line, .gmrq-line-name, .gmrq-line-qty, .gmrq-line-remove, .gmrq-update, .gmrq-remove, .gmrq-request, .gmrq-field, .gmrq-submit.

.gmrq-button { background: #2c3e50; color: #fff; }

Free edition

The free edition applies no filters or actions of its own. Its schema marker is gmrqf_db_version. The store email goes to admin_email with the subject "New quote request".

Full edition

Filters

gmrq_applies

Whether a product is quote-only, after the plugin's own decision.

Argument Type
$applies bool The plugin's answer
$product_id int The product (a variation's parent)
// Quote anything over 1,000; sell the rest.
add_filter( 'gmrq_applies', function ( $applies, $product_id ) {
	$product = wc_get_product( $product_id );
	return $applies || ( $product && (float) $product->get_price() > 1000 );
}, 10, 2 );

gmrq_email

One outgoing message. Return false (or an array with an empty to) to hold it.

Argument Type
$message array to, subject, body
$quote array The quote row
$kind string requested (to the shop), quoted (to the customer), accepted (to the shop)
// Send new requests to the sales inbox.
add_filter( 'gmrq_email', function ( $message, $quote, $kind ) {
	if ( 'requested' === $kind || 'accepted' === $kind ) {
		$message['to'] = 'sales@example.com';
	}
	return $message;
}, 10, 3 );

gmrq_basket_limit

How many lines a quote list may hold. Default 50.

gmrq_settings, gmrq_modules, gmrq_license_api_url, gmrq_update_cache_ttl

The merged settings, the module list, the licence API base URL and the update payload cache lifetime.

Actions

gmrq_quote_converted

Fires after an accepted quote has become an order.

Argument Type
$order_id int The new order
$quote array The quote row

gmrq_booted

After every module has booted; receives the service container.

Quote link

?gmrq_quote=<token> on the quote list page (or the home page when none is set). The page content is replaced by the quote through the_content at priority 20.

Order meta

_gmrq_quote_id on an order made from a quote.

More CSS classes

The customer's quote: .gmrq-quote, .gmrq-line-price, .gmrq-total, .gmrq-reply, .gmrq-decide, .gmrq-accept, .gmrq-decline, .gmrq-accepted, .gmrq-declined, .gmrq-expired, .gmrq-unknown.

Other storage

Item Name
Schema marker gmrq_db_version
Licence gmrq_license
Update cache transient gmrq_update_payload
Cron gmrq_license_check (only with a key)
Shopping Cart
Scroll to Top