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.
| Hook | Type | Arguments | Purpose |
|---|
mkl_pc/quote_request/enabled | filter | $enabled | Whether quote requests are on |
mkl_pc/quote_request/product_mode | filter | $mode, $product_id | A product's mode: default, quote_only or off |
mkl_pc/quote_request/can_quote | filter | $can_quote, $product_id, $variation_id | Whether a product can be quoted |
mkl_pc/quote_request/fields | filter | $fields, $context | The form fields, keyed by id |
mkl_pc/quote_request/field_label | filter | $translated, $label, $field_id | Translate a typed label, for translation plugins other than WPML and Polylang |
mkl_pc/quote_request/sanitize_field | filter | $value, $raw, $field | Sanitize a value, for your own field types |
mkl_pc/quote_request/validate_field | filter | $result, $value, $field | Validate a value: return a WP_Error to refuse it |
mkl_pc/quote_request/account_details | filter | $details, $user | What an account gives a request, keyed by maps_to |
mkl_pc/quote_request/account_values | filter | $values, $user_id, $context | The values the form starts with for a signed-in customer. Return [] to start empty |
mkl_pc/quote_request/schema | filter | $schema, $product_id | The schema sent to the browser |
mkl_pc/quote_request/validate | filter | $errors, $request, $args | Refuse a request by adding errors to the WP_Error |
mkl_pc/quote_request/reference | filter | $reference | The reference (Q-20261102-7F3K). One already used is drawn again |
mkl_pc/quote_request/response | filter | $response, $request | The REST response, e.g. to add a redirect URL |
Storing and sending
| Hook | Type | Arguments | Purpose |
|---|
mkl_pc/quote_request/stores | filter | $stores | The places a request can be kept, keyed by id |
mkl_pc/quote_request/stored | action | $request | Stored, before the emails: add files here so the emails can attach them |
mkl_pc/quote_request/created | action | $request | Stored and emailed |
mkl_pc/quote_request/order_created | action | $order, $request | A request became a WooCommerce order |
mkl_pc/quote_request/quote_sent | action | $request, $message | The merchant emailed the quote |
mkl_pc/quote_request/configuration_updated | action | $request, $old | The merchant changed the configuration |
mkl_pc/quote_request/retention_days | filter | $days | How long stored requests are kept. 0 keeps them |
mkl_pc/email/quote_request/after_details | action | $request, $sent_to_admin, $plain_text, $email | After the request in the emails |
The customer's side
| Hook | Type | Arguments | Purpose |
|---|
mkl_pc/quote_request/customer_status_labels | filter | $labels, $request | The statuses as customers read them |
mkl_pc/quote_request/customer_template | filter | $file, $template, $args | The file of a customer page template |
mkl_pc/quote_request/customer_view/after | action | $request | After a request on the customer page |
mkl_pc/quote_request/customer_answers | filter | $answers, $request | The answers offered now: accept, decline, change |
mkl_pc/quote_request/accept_creates_order | filter | $creates, $request | Whether accepting makes an order to pay. Default: with WooCommerce |
mkl_pc/quote_request/customer_answered | action | $request, $answer, $message, $order | The customer answered |
mkl_pc/quote_request/account_endpoint | filter | 'quote-requests' | The My account endpoint |
mkl_pc/quote_request/show_account_tab | filter | $shown | Whether My account shows the tab |
mkl_pc/quote_request/pdf_provider | filter | $provider | What makes the PDF: a Quote_PDF_Provider |
mkl_pc/quote_request/pdf_filename | filter | $filename, $request | The PDF's file name |
The request screen
| Hook | Type | Arguments | Purpose |
|---|
mkl_pc/admin/quote_request/after_configuration | action | $request | After the configuration, in the Configuration box |
mkl_pc/admin/quote_request/status_box | action | $post | In 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.
| Hook | Type | Arguments | Purpose |
|---|
mkl_pc/configuration_editor/order_is_editable | filter | $editable, $order | Whether an order's lines can be configured. Default: when WooCommerce lets the order be edited |
mkl_pc/configuration_editor/clear_meta_keys | filter | $keys, $item | Meta removed from a line before it gets its new configuration: add-ons that add line meta list theirs |
mkl_pc/configuration_editor/item_saved | action | $item, $order, $old_data | A line got a configuration, before the order totals are recalculated |
mkl_pc/configuration_editor/register_targets | action | $editor | Register more things to configure, with register_target() |
mkl_pc/frame/is_frame_request | filter | $is_frame, $product_id | Whether to serve the product as the bare configurator |
mkl_pc/frame/setup | action | $product_id | The bare configurator is about to be served |
JavaScript
| Hook | Type | Arguments | Purpose |
|---|
PC.fe.quote.form_fields | filter | fields, schema | The fields shown in the request window |
PC.fe.quote.field_values | filter | {} | Values of fields shown outside the window |
PC.fe.quote.validate_fields | filter | errors, values, schema | Field errors before sending |
PC.fe.quote.needs_form | filter | needs, schema | Whether the window asks anything, or sends straight away |
PC.fe.quote.request_body | filter | body, options | The request sent to the server |
PC.fe.quote.request_files | filter | [], body | Files to send with it |
PC.fe.quote.sent | action | result, body | The request was sent |
PC.fe.quote.button_added | action | $button, mode | The Request a quote button was added |
PC.fe.quote.form.before_show | action | view | Before the window opens |
PC.fe.quote.form.render | action | view | The window was drawn |
PC.fe.quote.form.valid | filter | valid, view | Whether the window's own sections are valid |
PC.fe.quote.field_errors | action | errors, view | Errors on fields shown outside the window |