Guide

Quote request hooks

Hooks of the quote requests, and of configuring orders and requests from the admin. For the API, see Quote request API.

See the hook reference index for how to register callbacks.

The request and its form

HookTypeArgumentsPurpose
mkl_pc/quote_request/enabledfilter$enabledWhether quote requests are on
mkl_pc/quote_request/product_modefilter$mode, $product_idA product's mode: default, quote_only or off
mkl_pc/quote_request/can_quotefilter$can_quote, $product_id, $variation_idWhether a product can be quoted
mkl_pc/quote_request/fieldsfilter$fields, $contextThe form fields, keyed by id
mkl_pc/quote_request/field_labelfilter$translated, $label, $field_idTranslate a typed label, for translation plugins other than WPML and Polylang
mkl_pc/quote_request/sanitize_fieldfilter$value, $raw, $fieldSanitize a value, for your own field types
mkl_pc/quote_request/validate_fieldfilter$result, $value, $fieldValidate a value: return a WP_Error to refuse it
mkl_pc/quote_request/account_detailsfilter$details, $userWhat an account gives a request, keyed by maps_to
mkl_pc/quote_request/account_valuesfilter$values, $user_id, $contextThe values the form starts with for a signed-in customer. Return [] to start empty
mkl_pc/quote_request/schemafilter$schema, $product_idThe schema sent to the browser
mkl_pc/quote_request/validatefilter$errors, $request, $argsRefuse a request by adding errors to the WP_Error
mkl_pc/quote_request/referencefilter$referenceThe reference (Q-20261102-7F3K). One already used is drawn again
mkl_pc/quote_request/responsefilter$response, $requestThe REST response, e.g. to add a redirect URL

Storing and sending

HookTypeArgumentsPurpose
mkl_pc/quote_request/storesfilter$storesThe places a request can be kept, keyed by id
mkl_pc/quote_request/storedaction$requestStored, before the emails: add files here so the emails can attach them
mkl_pc/quote_request/createdaction$requestStored and emailed
mkl_pc/quote_request/order_createdaction$order, $requestA request became a WooCommerce order
mkl_pc/quote_request/quote_sentaction$request, $messageThe merchant emailed the quote
mkl_pc/quote_request/configuration_updatedaction$request, $oldThe merchant changed the configuration
mkl_pc/quote_request/retention_daysfilter$daysHow long stored requests are kept. 0 keeps them
mkl_pc/email/quote_request/after_detailsaction$request, $sent_to_admin, $plain_text, $emailAfter the request in the emails

The customer's side

HookTypeArgumentsPurpose
mkl_pc/quote_request/customer_status_labelsfilter$labels, $requestThe statuses as customers read them
mkl_pc/quote_request/customer_templatefilter$file, $template, $argsThe file of a customer page template
mkl_pc/quote_request/customer_view/afteraction$requestAfter a request on the customer page
mkl_pc/quote_request/customer_answersfilter$answers, $requestThe answers offered now: accept, decline, change
mkl_pc/quote_request/accept_creates_orderfilter$creates, $requestWhether accepting makes an order to pay. Default: with WooCommerce
mkl_pc/quote_request/customer_answeredaction$request, $answer, $message, $orderThe customer answered
mkl_pc/quote_request/account_endpointfilter'quote-requests'The My account endpoint
mkl_pc/quote_request/show_account_tabfilter$shownWhether My account shows the tab
mkl_pc/quote_request/pdf_providerfilter$providerWhat makes the PDF: a Quote_PDF_Provider
mkl_pc/quote_request/pdf_filenamefilter$filename, $requestThe PDF's file name

The request screen

HookTypeArgumentsPurpose
mkl_pc/admin/quote_request/after_configurationaction$requestAfter the configuration, in the Configuration box
mkl_pc/admin/quote_request/status_boxaction$postIn the Status box, before the buttons

Configuring from the admin

The configurator opens in a window, for an order line, a new order line, or a quote request.

HookTypeArgumentsPurpose
mkl_pc/configuration_editor/order_is_editablefilter$editable, $orderWhether an order's lines can be configured. Default: when WooCommerce lets the order be edited
mkl_pc/configuration_editor/clear_meta_keysfilter$keys, $itemMeta removed from a line before it gets its new configuration: add-ons that add line meta list theirs
mkl_pc/configuration_editor/item_savedaction$item, $order, $old_dataA line got a configuration, before the order totals are recalculated
mkl_pc/configuration_editor/register_targetsaction$editorRegister more things to configure, with register_target()
mkl_pc/frame/is_frame_requestfilter$is_frame, $product_idWhether to serve the product as the bare configurator
mkl_pc/frame/setupaction$product_idThe bare configurator is about to be served

JavaScript

HookTypeArgumentsPurpose
PC.fe.quote.form_fieldsfilterfields, schemaThe fields shown in the request window
PC.fe.quote.field_valuesfilter{}Values of fields shown outside the window
PC.fe.quote.validate_fieldsfiltererrors, values, schemaField errors before sending
PC.fe.quote.needs_formfilterneeds, schemaWhether the window asks anything, or sends straight away
PC.fe.quote.request_bodyfilterbody, optionsThe request sent to the server
PC.fe.quote.request_filesfilter[], bodyFiles to send with it
PC.fe.quote.sentactionresult, bodyThe request was sent
PC.fe.quote.button_addedaction$button, modeThe Request a quote button was added
PC.fe.quote.form.before_showactionviewBefore the window opens
PC.fe.quote.form.renderactionviewThe window was drawn
PC.fe.quote.form.validfiltervalid, viewWhether the window's own sections are valid
PC.fe.quote.field_errorsactionerrors, viewErrors on fields shown outside the window