Skip to main content

Developer hooks

Add these to your theme's functions.php or a small plugin.

Buttons and messages​

HookTypeArgumentsUse
wpheka_rfq_display_for_product_typefilterstring[] $typesProduct types that get the button on shop and category pages (default simple, subscription, external)
wpheka_rfq_product_added_to_list_messagefilterstring $message"Product added to quote list."
wpheka_rfq_product_already_in_list_messagefilterstring $message"Product already in the quote list."
wpheka_rfq_product_added_view_browse_listfilterstring $textThe "Browse the list" link text
wpheka_rfq_product_error_messagefilterstring $messageThe message when a product can't be added
wpheka_request_page_urlfilterstring $urlThe quote list page URL

The quote list page​

HookTypeArgumentsUse
wpheka_rfq_content_start / wpheka_rfq_content_endactionnoneStart and end of the shortcode's output
wpheka_check_quote_itemsactionnoneBefore the list is shown
wpheka_before_rfq_list / wpheka_after_rfq_listactionnoneBefore and after the list form. The request form is printed on wpheka_after_rfq_list.
wpheka_before_rfq_list_table / wpheka_after_rfq_list_tableactionnoneBefore and after the table
wpheka_before_rfq_list_contents / wpheka_after_rfq_list_contentsactionnoneFirst and last rows of the table
wpheka_rfq_list_contentsactionnoneAfter the product rows
wpheka_rfq_actionsactionnoneNext to the Update list button
wpheka_after_rfq_item_nameactionarray $item, string $keyAfter a product's name
wpheka_cart_is_emptyactionnoneOn the empty quote list
wpheka_rfq_item_productfilterWC_Product $product, array $item, string $keyThe product shown for a row (also in the email)
wpheka_rfq_item_product_idfilterint $id, array $item, string $keyThe product ID of a row (also in the email)
wpheka_rfq_item_visiblefilterbool $visible, array $item, string $keyHide a row
wpheka_rfq_item_classfilterstring $class, array $item, string $keyCSS class of a row
wpheka_rfq_item_permalinkfilterstring $url, array $item, string $keyProduct link
wpheka_rfq_item_thumbnailfilterstring $html, array $item, string $keyProduct image
wpheka_rfq_item_namefilterstring $html, array $item, string $keyProduct name
wpheka_rfq_item_pricefilterstring $html, array $item, string $keyPrice cell
wpheka_rfq_item_quantityfilterstring $html, string $key, array $itemQuantity cell
wpheka_rfq_item_subtotalfilterstring $html, array $item, string $keySubtotal cell
wpheka_rfq_item_remove_linkfilterstring $html, string $keyThe remove (×) link
wpheka_rfq_item_backorder_notificationfilterstring $html, int $product_id"Available on backorder"

The request form​

HookTypeArgumentsUse
wpheka_before_rfq_form_start / wpheka_after_rfq_form_endactionnoneBefore and after the form
wpheka_rfq_form_startactionnoneFirst thing inside the form
wpheka_rfq_formactionnoneAfter the message field
wpheka_rfq_form_endactionnoneLast thing inside the form

The quote email​

HookTypeArgumentsUse
wpheka_rfq_email_items_headingfilterstring $heading, WC_Email $emailThe "Quote summary" heading (HTML email)
wpheka_rfq_email_before_items_tableactionarray $items, WC_Email $emailBefore the products
wpheka_rfq_email_after_items_tableactionarray $items, WC_Email $emailAfter the products

The email templates are emails/request-for-quote-mail-template.php and emails/plain/request-for-quote-mail-template.php. Copy one to yourtheme/woocommerce/ to change it.

Setup, sessions and caching​

HookTypeArgumentsUse
wpheka_rfq_loadedactionnoneThe plugin has loaded
wpheka_rfq_initactionnoneThe plugin has initialised
wpheka_rfq_installedactionnoneAfter activation set things up
wpheka_rfq_create_pagesfilterarray $pagesPages created on activation
wpheka_rfq_create_page_idfilterint $id, string $slug, string $contentUse an existing page instead of creating one
wpheka_rfq_shortcode_tagfilterstring $tagThe shortcode put on the created page
wpheka_rfq_session_handlerfilterstring $classSession handler class
wpheka_rfq_cookiefilterstring $nameSession cookie name
wpheka_rfq_session_expiringfilterint $secondsWhen a session starts to expire (default 47 hours)
wpheka_rfq_session_expirationfilterint $secondsWhen a session expires (default 48 hours)
wpheka_rfq_prevent_page_cachingfilterbool $preventWhether the current page must not be cached (default: on the quote list page)
wpheka_rfq_purge_cachesactionnoneAfter saving settings cleared the known page caches. Clear your own cache here.

Examples​

Show the button on shop and category pages for simple products only:

add_filter( 'wpheka_rfq_display_for_product_type', function () {
return array( 'simple' );
} );

Change the message after adding a product:

add_filter( 'wpheka_rfq_product_added_to_list_message', function () {
return 'Added. Send your list when you are ready.';
} );