Developers
Shortcodes, blocks, template overrides, hooks and webhooks. All hooks and functions use the blraq prefix.
Shortcodes
| Shortcode | Output |
|---|---|
[blraq_quote] | The quote list and request form — same as the Request a Quote block. Place it on the page selected as Quote page. |
[blraq_quote_link label="Quote" show_count="yes"] | A link to the quote page. label sets the text (default "Quote"); show_count adds the number of products in the list (yes / no). |
[blraq_button id="123"] | An "Add to quote" button for product 123. Without id it uses the current product. |
Blocks
| Block | Name | Options |
|---|---|---|
| Request a Quote | brainlessitc-request-product-quote-for-woocommerce/quote | Quote list and request form. Supports wide / full alignment. |
| Quote List Link | brainlessitc-request-product-quote-for-woocommerce/quote-link | label, showCount, plus text color, background color and font size. |
"Add to quote" buttons are added automatically to the WooCommerce Add to Cart Form, Add to Cart with Options and Product Button blocks (used by Product Collection), and to classic templates.
Template overrides
Copy a template from the plugin's templates/ folder into your theme, keeping the sub-folder, and edit the copy:
wp-content/plugins/brainlessitc-request-product-quote-for-woocommerce/templates/quote/form.php
→ wp-content/themes/your-theme/brainlessitc-request-product-quote-for-woocommerce/quote/form.php
Pro templates are overridden in the same theme folder.
| Template | Used for |
|---|---|
quote/basket.php | The quote list on the quote page |
quote/form.php | The request form |
quote/empty.php | Empty quote list |
quote/login-required.php | Shown to guests when guest requests are off |
quote/received.php | Confirmation after sending |
emails/admin-new-quote.php, customer-quote-received.php, customer-quote-reply.php | HTML emails (plain-text versions in emails/plain/) |
emails/quote-items.php, emails/quote-details.php | Products table and customer details used in emails and pages |
quote/proposal.php PRO | Customer view of a proposal |
myaccount/quotes.php PRO | My Account › Quotes list |
pdf/quote.php PRO | PDF quote (rendered by Dompdf — keep to tables and inline CSS) |
emails/customer-proposal.php, customer-reminder.php, admin-quote-decision.php PRO | Pro emails (plain versions in emails/plain/) |
Helper functions
| Function | Returns |
|---|---|
blraq() | The plugin instance (services such as ->settings, ->quotes, ->basket, ->products). |
blraq_get_quote( $id ) | A Quote object, or null. |
blraq_get_setting( $key, $fallback = null ) | A setting value, e.g. blraq_get_setting( 'hide_price' ) → 'yes' / 'no'. |
blraq_get_quote_page_url() | URL of the quote page. |
blraq_is_quote_page() | Whether the current request is the quote page. |
blraq_get_template( $name, $args ) | Loads a template (theme overrides first). |
Useful Quote methods: get_id(), get_number(), get_status(), get_status_label(), get_customer_name(), get_customer_email(), get_items(), get_form_data(), get_field( $key ), get_total(), get_meta( $key ) and get_admin_url().
Examples
Add these snippets to a small custom plugin or with a code-snippets plugin.
Let shop managers without full WooCommerce rights manage quotes
add_filter( 'blraq_manage_capability', function () {
return 'edit_shop_orders'; // Default: manage_woocommerce.
} );
No quotes for one category
add_filter( 'blraq_is_product_quotable', function ( $quotable, $product ) {
$id = $product->get_parent_id() ? $product->get_parent_id() : $product->get_id();
if ( has_term( 'gift-cards', 'product_cat', $id ) ) {
return false;
}
return $quotable;
}, 10, 2 );
Add a "VAT number" field to the form
add_filter( 'blraq_form_fields', function ( $fields ) {
$fields['vat_number'] = array(
'type' => 'text',
'label' => __( 'VAT number', 'my-textdomain' ),
'required' => false,
'class' => array( 'form-row-wide' ),
'priority' => 55, // Company is 50, Message 60.
);
return $fields;
} );
The value is sanitized, validated and stored with the quote like the built-in fields, and shown on the quote screen and in emails.
Send new requests to your CRM
add_action( 'blraq_quote_created', function ( $quote_id, $quote ) {
wp_remote_post( 'https://crm.example.com/api/leads', array(
'body' => array(
'name' => $quote->get_customer_name(),
'email' => $quote->get_customer_email(),
'quote' => $quote->get_number(),
),
) );
}, 10, 2 );
Prefix quote numbers
add_filter( 'blraq_quote_number', function ( $number, $quote ) {
return 'Q-' . str_pad( $number, 5, '0', STR_PAD_LEFT ); // Q-00058
}, 10, 2 );
React to status changes
add_action( 'blraq_quote_status_changed', function ( $quote, $old_status, $new_status ) {
if ( 'accepted' === $new_status ) {
// e.g. notify your sales team.
}
}, 10, 3 );
// Or listen to one status only: blraq_quote_status_{status}, e.g. blraq_quote_status_accepted ( $quote, $old_status ).
Actions
| Action | Arguments | Fires when |
|---|---|---|
blraq_loaded | $plugin | The plugin has booted. |
blraq_added_to_basket | $key, $product, $quantity | A product was added to a quote list. |
blraq_basket_updated | $basket | The quote list changed. |
blraq_before_create_quote | $quote, $basket | Before a submitted request is saved. |
blraq_quote_created | $quote_id, $quote | A new quote request was saved. |
blraq_before_save_quote / blraq_quote_saved | $quote, $is_new | Before / after any quote is saved. |
blraq_quote_status_changed | $quote, $old_status, $new_status | The status changed. |
blraq_quote_status_{status} | $quote, $old_status | The quote moved to {status}. |
blraq_quote_note_added | $note_id, $quote_id, $type | A note was added ($type: private, customer, incoming or system). |
blraq_customer_reply_sent | $sent, $quote | A reply email was attempted. |
blraq_before_delete_quote / blraq_quote_deleted | $quote / $id | Before / after a quote is deleted. |
blraq_validate_submission | $errors, $posted, $data | Validate the whole request; add errors to the WP_Error. $posted is already sanitized. |
blraq_before_form_fields / blraq_after_form_fields | — | Print extra markup around the form fields. |
blraq_basket_item_after_name | $item, $key | Under a product name in the quote list. |
blraq_basket_form_updated | $item_meta | The quote list form was posted; extra item fields (sanitized) keyed by item key. |
blraq_ajax_update_item | $key, $meta | A quote list item was updated via AJAX; $meta is sanitized. |
blraq_after_quote_received | $quote | Below the confirmation after sending. |
blraq_quote_item_meta | $item, $quote, $sent_to_admin | Under a product in quote tables (emails, pages). |
blraq_admin_quote_main / _sidebar / _actions / _info | $quote | Add boxes and controls to the quote screen. |
blraq_admin_before_save_quote / blraq_admin_save_quote | $quote | The quote screen is being saved (nonce and capability already verified). Read and sanitize your own fields. |
blraq_product_panel / blraq_save_product_fields | — / $product | Extend the product's Request a Quote tab. |
blraq_settings_saved | $tab, $updates | A settings tab was saved. |
blraq_quote_page_override | — | Print replacement quote-page content when blraq_has_quote_page_override returns true. Escape everything you print. |
Filters
| Filter | Arguments | Filters |
|---|---|---|
blraq_is_product_quotable | $quotable, $product | Whether a product can be quoted. |
blraq_hide_price | $hide, $product | Whether the price is hidden. |
blraq_hide_add_to_cart | $hide, $product | Whether Add to cart is hidden and blocked. |
blraq_price_replacement_text | $text, $product | Text shown instead of a hidden price. |
blraq_allow_out_of_stock | $allow, $product | Allow quotes for out-of-stock products. |
blraq_supported_product_types | $types | Product types that can be quoted (default simple, variable, variation). |
blraq_validate_add_to_basket | $valid, $product, $quantity | Allow or refuse adding to the quote list (return WP_Error to show a message). |
blraq_basket_item_quantity / blraq_basket_item_meta | $value, $product | Quantity / extra data of a new list item. |
blraq_button_label | $label, $product, $context | Button text ($context: single or loop). |
blraq_button_classes | $classes, $context | Button CSS classes. |
blraq_added_message | $html, $product | Message after adding a product (non-JS). |
blraq_form_fields | $fields | Request form fields (see example). |
blraq_form_field_args | $args, $key, $value | Arguments passed to woocommerce_form_field(). |
blraq_form_default_values | $values | Pre-filled values (logged-in customers get their billing details). |
blraq_validate_field | $valid, $value, $field | Validate one field; return WP_Error to reject. |
blraq_submission_data | $data, $posted | Clean data stored with the quote. |
blraq_submit_button_text | $text | Submit button label. |
blraq_submit_redirect | $url, $quote | Where customers go after sending. |
blraq_min_submit_seconds | $seconds | Minimum time between loading and sending the form (spam check). |
blraq_client_ip | $ip | Visitor IP used for rate limiting (e.g. behind a proxy). |
blraq_quote_statuses | $statuses | Register or relabel statuses (key => [ label, color ]). |
blraq_quote_number | $number, $quote | Displayed quote number. |
blraq_display_item_price | $price, $item, $quote, $sent_to_admin | Unit price shown in quote tables (null hides it). |
blraq_quote_totals_rows | $rows, $quote, $total, $sent_to_admin | Totals rows below quote tables. |
blraq_quote_page_url | $url | URL of the quote page. |
blraq_has_quote_page_override | $override | Return true to replace the quote page content (print it on blraq_quote_page_override). |
blraq_manage_capability | $cap | Capability to manage quotes and settings (default manage_woocommerce). |
blraq_list_table_columns / blraq_list_table_column_{name} / blraq_list_table_row_actions | … | Customize the quotes list. |
blraq_settings_schema | $schema, $settings | Add settings tabs, sections and fields. |
blraq_default_settings / blraq_setting_{key} | $defaults / $value, $key | Default values / a single setting value. |
blraq_template_default_path | $path, $template_name | Folder templates are loaded from. |
blraq_upgrade_url | $url | "Get Pro" link target. |
Pro hooks PRO
| Hook | Arguments | Purpose |
|---|---|---|
blraq_pro_loaded (action) | $pro | Pro has booted (with an active license). |
blraq_pro_proposal_sent (action) | $quote, $sent | A proposal email was sent. |
blraq_pro_order_created (action) | $order, $quote | A quote was turned into an order. |
blraq_pro_order_from_quote (filter) | $order, $quote | Adjust the order before it is saved. |
blraq_pro_proposal_totals (filter) | $totals, $quote | Proposal subtotal, discount, shipping, fee and total. |
blraq_pro_proposal_visible_statuses (filter) | $statuses | Statuses in which customers can see proposal prices. |
blraq_pro_pdf_filename (filter) | $name, $quote | PDF file name without .pdf (default quote-{number}). |
blraq_pro_webhook_payload (filter) | $payload, $event, $quote | Change the webhook JSON. |
Webhooks PRO
Configure delivery URLs and a signing secret in Settings › Integrations. Events are delivered in the background as an HTTP POST with a JSON body.
| Event | When |
|---|---|
quote.created | A new quote request was submitted. |
quote.status_changed | A quote changed status. |
Headers
Content-Type: application/jsonX-BLRAQ-Event— the event name.X-BLRAQ-Delivery— a unique ID per delivery.X-BLRAQ-Signature— when a secret is set: base64 of the HMAC-SHA256 of the raw body, keyed with your secret.
Payload
{
"event": "quote.created",
"site": "https://example.com/",
"quote": {
"id": 58,
"number": "58",
"status": "new",
"status_label": "New",
"currency": "USD",
"total": 1080,
"customer": { "id": 0, "name": "Sofia Martinez", "email": "sofia@example.com" },
"fields": {
"company": { "label": "Company", "value": "Casa Boutique" },
"message": { "label": "Message", "value": "Wholesale pricing for 3 products." }
},
"items": [
{
"product_id": 21, "variation_id": 0, "name": "Shoes", "sku": "woo-fashion-shoes",
"quantity": 30, "price": 18, "offered_price": null, "attributes": {}
}
],
"order_id": 0,
"created_at": "2026-10-01T06:02:00+00:00",
"expires_at": null,
"admin_url": "https://example.com/wp-admin/admin.php?page=blraq-quotes"e=58"
},
"sent_at": "2026-10-01T06:02:05+00:00"
}
Verify the signature (PHP)
$body = file_get_contents( 'php://input' );
$expected = base64_encode( hash_hmac( 'sha256', $body, 'your-signing-secret', true ) );
$signature = isset( $_SERVER['HTTP_X_BLRAQ_SIGNATURE'] ) ? $_SERVER['HTTP_X_BLRAQ_SIGNATURE'] : '';
if ( ! hash_equals( $expected, $signature ) ) {
http_response_code( 401 );
exit;
}
$event = json_decode( $body, true );
Stored data
- Custom tables:
{prefix}blraq_quotes,{prefix}blraq_quote_items,{prefix}blraq_quote_notesand{prefix}blraq_quotemeta. Compatible with WooCommerce HPOS. - Options:
blraq_settings; with Pro alsoblraq_pro_settings,blraq_pro_rulesandblraq_pro_form. - Product meta:
_blraq_quote,_blraq_hide_price,_blraq_hide_atc(per-product overrides). - Pro uploads: files from upload fields are stored in a protected folder inside
wp-content/uploadsand served only to store managers. - Nothing is removed on deactivation; see Remove data on uninstall.