Skip to content

Request for quote (RFQ)

The RFQ module replaces “Add to cart” with “Ask for price”. Customers submit quote requests instead of buying directly. Useful for B2B stores and products with individual pricing.

Go to WooCommerce > Settings > Polski PRO > Request for quote and enable the module.

SettingDatabase optionDefault valueDescription
Enable modulepolski_quoteNoActivates the request for quote functionality
Button textpolski_quote_button_text”Zapytaj o cenę”Text displayed on the button
Show on listingspolski_quote_show_on_loopsNoDisplays the quote button on archive and category pages
Require loginpolski_quote_require_loginNoRequires login before submitting a request
Processing consentpolski_quote_consentYesAdds a GDPR consent checkbox to the form

The quote request form contains by default:

  • First and last name - required
  • Email address - required, format validation
  • Phone - optional
  • Quantity - required, numeric validation
  • Message - optional, textarea
  • GDPR consent - checkbox, required if enabled

After enabling the module, the “Add to cart” button is replaced with the quote request button. This applies to:

  • Single product page
  • Archive and category pages (if the polski_quote_show_on_loops option is enabled)
  • Product widgets and shortcodes

The quote request button can be placed anywhere using the shortcode:

[polski_quote_button product_id="123" text="Zapytaj o cenę" class="custom-class"]

Parameters:

ParameterRequiredDescription
product_idNoProduct ID (defaults to current product)
textNoButton text
classNoAdditional CSS classes

The form is submitted asynchronously (AJAX) without page reload. After submission, the customer sees a confirmation message with the request number.

/**
* Filtruje dane zapytania ofertowego przed zapisem.
*
* @param array $quote_data Dane zapytania
* @param int $product_id ID produktu
* @param \WP_User $user Obiekt zalogowanego użytkownika lub pusty
*/
apply_filters('polski_pro/quote/before_save', array $quote_data, int $product_id, $user): array;

Example - adding a custom field:

add_filter('polski_pro/quote/before_save', function (array $quote_data, int $product_id, $user): array {
$quote_data['meta']['company_nip'] = sanitize_text_field($_POST['company_nip'] ?? '');
return $quote_data;
}, 10, 3);

Each quote request saves consent information:

  • Timestamp of consent given
  • Client IP address (SHA-256 hashed)
  • Consent content at the time of granting
  • Form version

This data is stored in the {prefix}_polski_quote_consents table and can be exported for GDPR audit purposes.

/**
* Akcja wywoływana po zapisaniu zgody.
*
* @param int $quote_id ID zapytania ofertowego
* @param array $consent Dane zgody
* @param string $ip_hash Zahashowany adres IP
*/
do_action('polski_pro/quote/consent_logged', int $quote_id, array $consent, string $ip_hash);

Quote requests are available in the WooCommerce > Quote requests menu. The list contains:

  • Request number
  • Customer data (name, email, phone)
  • Product and quantity
  • Status (new, in progress, replied, closed)
  • Submission date
StatusDescription
newNew request, unprocessed
in_progressQuote being prepared
repliedQuote sent to the customer
acceptedCustomer accepted the quote
rejectedCustomer rejected the quote
closedRequest closed

From the panel, the administrator can:

  1. Review request details
  2. Add an internal note
  3. Set the quoted price
  4. Send an email response to the customer
  5. Convert the request into a WooCommerce order

The module registers the following email templates in WooCommerce:

EmailRecipientTrigger
New quote requestAdministratorCustomer submits a request
Request confirmationCustomerRequest submission
Quote responseCustomerAdministrator sends a quote
Request status changeCustomerRequest status change

Email templates can be overridden in the theme in the woocommerce/emails/ directory:

  • polski-pro-quote-new.php
  • polski-pro-quote-confirmation.php
  • polski-pro-quote-reply.php
  • polski-pro-quote-status.php
/**
* Filtruje pola formularza zapytania ofertowego.
*
* @param array $fields Tablica pól formularza
* @param int $product_id ID produktu
*/
apply_filters('polski_pro/quote/form_fields', array $fields, int $product_id): array;

Example - adding a VAT ID field:

add_filter('polski_pro/quote/form_fields', function (array $fields, int $product_id): array {
$fields['company_nip'] = [
'type' => 'text',
'label' => 'NIP firmy',
'required' => false,
'priority' => 35,
];
return $fields;
}, 10, 2);
/**
* Akcja wywoływana po zapisaniu zapytania ofertowego.
*
* @param int $quote_id ID zapytania
* @param array $quote_data Dane zapytania
*/
do_action('polski_pro/quote/submitted', int $quote_id, array $quote_data);

Example - sending to CRM:

add_action('polski_pro/quote/submitted', function (int $quote_id, array $quote_data): void {
$crm_api = new MyCrmApi();
$crm_api->create_lead([
'name' => $quote_data['name'],
'email' => $quote_data['email'],
'product' => $quote_data['product_name'],
'qty' => $quote_data['quantity'],
]);
}, 10, 2);

“Add to cart” button still displays Check if the polski_quote option is enabled. Clear the cache of caching plugins (WP Super Cache, W3 Total Cache, LiteSpeed Cache).

Form does not submit (AJAX error) Check the browser console for JavaScript errors. Make sure the polski-pro-quote.js script is loaded. Conflicts with other plugins may block AJAX - disable other plugins to identify the conflict.

Emails are not being sent Check the email configuration in WooCommerce > Settings > Emails. Make sure the Polski PRO templates are enabled.

This page is for informational purposes only and does not constitute legal advice. Consult a lawyer before implementation. Polski for WooCommerce is open source software (GPLv2) provided without warranty.