Skip to content

Developer guide

Everything Pro adds is reachable from code. Pro extends the free plugin only through hooks, and exposes its own for you to do the same. This page lists the seams Pro provides, the free-plugin seams Pro relies on that you will most often reuse, how to override the follow-up email template, and the data Pro stores.

Verified against the plugin source. Symbol names are the ones the code fires or reads.


Add your own fields to the quote form. Return an array keyed by field key; each value is a config array with type (text, textarea or select), label, required, and options for a select. Submitted values arrive under wcpq_custom_<field_key>.

add_filter(
'wcpq_pro_custom_fields',
function ( $fields ) {
$fields['project_deadline'] = array(
'type' => 'text',
'label' => 'Project deadline',
'required' => false,
);
return $fields;
}
);

The quote’s data array, filtered as a quote is built. This is the seam Pro’s own volume and role discounts use, and the place to apply business-specific pricing or add fields to the stored quote. Signature: ( array $quote_data, array $post_data ).

The plugin’s yes/no decision about whether one product can be quoted, applied after quote mode and the exclusion rules and before the button renders. Signature: ( bool $quotable, int $product_id ). See the product filtering page for a worked example (quote button only on out-of-stock products).

The list of quote statuses that still get a follow-up email when it comes due. Return an array; an empty array sends the follow-up regardless of status. See Email automation.

How long, in seconds, a built-in maths question stays valid (default one hour).

How many quotes the customer-email CSV export processes per batch (default 200). Lower it on a memory-constrained host.


Action Fired when Arguments
wcpq_pro_init Pro has loaded and the free plugin is present none
wcpq_quote_converted_to_order An approved quote became an order $quote_id, $order_id
wcpq_order_creation_failed Conversion failed $quote_id, $order (a WP_Error)
wcpq_quote_expired The daily task expired a quote $quote_id
wcpq_send_followup_email A scheduled follow-up is due $quote_id

The automated follow-up is a standard WooCommerce email (WC_Email_Customer_Quote_Followup). Copy the plugin’s template into your theme to change its markup:

your-theme/woocommerce/emails/customer-quote-followup.php
your-theme/woocommerce/emails/plain/customer-quote-followup.php

Its subject and heading are editable under WooCommerce > Settings > Emails, and support the {quote_id} and {customer_name} placeholders. The free plugin’s two base emails are overridden the same way.


Pro adds nothing to the free plugin’s tables. Its own data lives in options, a custom post type and standard WooCommerce order records.

Options (per-feature settings groups): wcpq_form_enhancement_settings, wcpq_email_settings, wcpq_pricing_settings, wcpq_product_filtering_settings, wcpq_quote_management_settings. Licensing uses edd_wbcom_wcpq_license_key and edd_wbcom_wcpq_license_status. A one-time flag wcpq_pro_hide_prices_migrated guards a legacy migration.

Quote mirror - the wcpq_quote custom post type mirrors each free quote row when Quote Status Management is on, with meta: _wcpq_quote_id, _wcpq_quote_status, _wcpq_history, _wcpq_expiry_date, _wcpq_order_id, _wcpq_products, _wcpq_total_value, _wcpq_customer_name, _wcpq_customer_email.

Orders - a converted quote becomes a normal WooCommerce order (created through the order API, HPOS-safe); the order id is stored back on the quote as _wcpq_order_id.

Cron - wcpq_daily_cron runs the daily expiry sweep.

Uninstall removes the quote posts in batches and cleans only the site it ran on.


  • Feature docs describe each setting these seams back.
  • The free plugin’s own hooks are documented with the free plugin.