Skip to content

Developer guide

Extension points, storage and template overrides for Price Quote for WooCommerce. Every hook below is present in this version’s source; the plugin prefixes all of its hooks with wcpq_.

  • wcpq_before_quote_button / wcpq_after_quote_button - fire immediately before and after the quote button markup.
  • wcpq_show_quote_button / wcpq_show_quote_button_single - fire where the button is rendered on archive and single-product views.
  • wcpq_before_quote_form_fields / wcpq_after_quote_form_fields - wrap the whole set of form fields.
  • wcpq_before_name_field / wcpq_after_name_field
  • wcpq_before_email_field / wcpq_after_email_field
  • wcpq_before_phone_field / wcpq_after_phone_field
  • wcpq_before_message_field / wcpq_after_message_field

These pairs let an add-on inject extra fields at a precise spot in the form.

  • wcpq_before_quote_submission / wcpq_after_quote_submission - fire around a request being saved.
  • wcpq_new_quote_request_notification - fires when the admin notification is triggered.
  • wcpq_customer_quote_confirmation_notification - fires when the customer confirmation is triggered.
  • wcpq_before_quote_status_update - fires with ( $quote_id, $old_status, $new_status ) before a status change is written.
  • wcpq_quote_status_updated - fires with ( $quote_id, $old_status, $new_status ) after the change is written.
  • wcpq_get_quote_mode - the active quote mode (all products or selected).
  • wcpq_product_quotable - whether a given product can be quoted.
  • wcpq_is_quote_available_for_user_role - whether the current user’s role may quote.
  • wcpq_get_disabled_user_roles - the roles that cannot quote.
  • wcpq_is_hide_add_to_cart / wcpq_is_hide_product_prices - the two display toggles.
  • wcpq_get_quote_click_action - what happens after a shopper clicks the button.
  • wcpq_button_classes - CSS classes on the quote button.
  • wcpq_button_radius - the button’s corner radius.
  • wcpq_get_add_to_quote_label / wcpq_get_remove_from_quote_label / wcpq_get_browse_quote_list_label - the three label strings.
  • wcpq_phone_field_required - return true to make the phone field mandatory (default false).
  • wcpq_quote_data - the assembled quote data before it is stored.
  • wcpq_quote_validation_errors - validation errors collected during submission.
  • wcpq_email_subject / wcpq_email_message - the subject and body of the response email.
  • wcpq_admin_email_recipient - the address the admin notification is sent to.
  • wcpq_settings_tabs - the settings tabs; add a tab here.
  • wcpq_quote_statuses - the status registry; Pro adds its statuses through this.
  • wcpq_admin_quotes_per_page - rows per page on the Quote Requests list (default 10).
  • wcpq_product_search_limit - matches returned by the product search (default 30).
  • wcpq_overview_stats / wcpq_overview_config_rows - the Overview tiles and config rows.
  • wcpq_quoted_products_columns - columns on the customer history table.
  • wcpq_quote_extra_fields_display - how add-on extra fields are shown on a request.
  • wcpq_admin_asset_screens - screens the admin CSS/JS load on.

Submitted quotes live in one custom table, {prefix}_wcpq_quote_requests. Its columns:

Column Type Notes
id mediumint Primary key.
customer_name varchar(255)
customer_email varchar(255) Indexed.
customer_phone varchar(50) Optional.
message text
product_ids text The quoted products.
extra_fields longtext Add-on data, such as Pro’s extra fields and attachments.
status varchar(20) Defaults to pending. Indexed.
user_id bigint 0 for a guest.
created_at datetime Indexed.
updated_at datetime Updated on change.

The table is owned by the activator and kept current with dbDelta. Data is never stored in post meta or options. Guest carts, before submission, are held in a wcpq_quote_products browser cookie with a 30-day expiry.

The two customer-facing emails follow the standard WooCommerce override path. Copy them from templates/emails/ in the plugin to woocommerce/emails/ in your theme:

  • admin-new-quote.php and plain/admin-new-quote.php
  • customer-quote-received.php and plain/customer-quote-received.php

The emails themselves register inside WooCommerce with the IDs admin_new_quote and customer_quote_received, so they behave like any other WooCommerce email under WooCommerce > Settings > Emails.