Hooks and templates for developers
Override QuoteLane’s templates in your theme, and change its behaviour with filters and actions.
Before you start
Put code like the examples below in a small custom plugin or your child theme’s functions.php, never in QuoteLane’s own files: updates replace them.
Override a template
QuoteLane loads its templates through WooCommerce’s template loader, so a copy in your theme wins.
| Template | Copy it to |
|---|---|
| Request page, quote page, thank-you page, My Account list, side panel | yourtheme/quotelane/ + the file name, for example yourtheme/quotelane/quote-view.php |
| Emails | yourtheme/woocommerce/emails/ + the file name, for example yourtheme/woocommerce/emails/qlane-proposal.php |
The originals are in the plugin’s templates/ and templates/emails/ folders. For emails, WooCommerce’s email settings show each template’s path and offer to copy it for you.
Careful Keep the do_action( 'qlane_request_form_end', $errors ) line in a copy of request-page.php: the spam check and the CAPTCHA are printed there, just above the send button. If the line is missing, QuoteLane adds them itself, but then it can’t follow your layout.
After an update, compare your copies with the new originals.
Filters
| Filter | What it changes | Default |
|---|---|---|
qlane_rule_decision |
The final rule decision for a product and customer. Gets $result, $product, $user. |
From your rules |
qlane_product_eligible |
Whether a product may be added to the quote list, after the rules. Gets $eligible, $product. |
From your rules |
qlane_quotable_types |
Product types that can be quoted | simple, variable, variation |
qlane_account_endpoint_slug |
The My Account address | quotes |
qlane_account_tab_label |
The name of the My Account tab with the customer’s quotes | Quotes (translated) |
qlane_rate_limit_per_hour |
Requests per IP address per hour | 10 |
qlane_rate_limit_per_email |
Requests per customer email address per day | 5 |
qlane_min_form_seconds |
Least time between showing the form and sending it | 3 |
qlane_client_ip |
The visitor’s address used for the limits | REMOTE_ADDR |
qlane_captcha_applies |
Whether this visitor must pass the CAPTCHA | Guests; logged-in customers only if set |
qlane_captcha_hostnames |
Host names a CAPTCHA answer may come from | Your site’s host names |
qlane_recaptcha_threshold |
Lowest reCAPTCHA v3 score that passes | 0.5 |
qlane_unpaid_order_grace_days |
Fewest days a customer has to pay after accepting, even on the quote’s last day | 3 |
qlane_cancel_unpaid_orders |
Whether unpaid orders are cancelled after that | true |
qlane_send_payment_email |
Whether the payment email goes out when an order is created. Gets $send, $order. |
true |
Actions
| Action | When it runs | Arguments |
|---|---|---|
qlane_quote_created |
A customer sent a request | $quote, $token (empty for logged-in customers) |
qlane_proposal_sent |
You sent or re-sent a proposal | $quote |
qlane_quote_accepted |
The customer accepted, after the order was created | $quote, $order (null if it failed) |
qlane_quote_converted |
A quote became a WooCommerce order | $quote, $order |
qlane_quote_declined_by_customer |
The customer declined | $quote |
qlane_declined_by_shop |
You marked a quote declined, just before the status changes | $quote |
qlane_quote_duplicated |
You copied a quote | $copy, $source |
qlane_quote_status_changed |
Any status change | $quote, $old, $new |
$quote is a \QuoteLane\Quote. Statuses are qlane-new, qlane-replied (proposal sent), qlane-accepted, qlane-declined, qlane-expired and qlane-converted.
Examples
Behind Cloudflare’s proxy, use the visitor’s real address for the limits:
add_filter( 'qlane_client_ip', function ( $ip ) {
return isset( $_SERVER['HTTP_CF_CONNECTING_IP'] )
? sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) )
: $ip;
} );
Only do this when all traffic really comes through Cloudflare; otherwise anyone can send that header.
Tell another system about each new request:
add_action( 'qlane_quote_created', function ( $quote ) {
// For example, send $quote->id to your CRM.
} );
Give customers who accept near the end at least 7 days to pay, instead of 3:
add_filter( 'qlane_unpaid_order_grace_days', fn () => 7 );
CSS
QuoteLane’s front-end markup uses class names starting with qlane- and one small stylesheet with low specificity, so your theme’s CSS can override it.