> This page is for version v1.
> For other versions, use one of these documentation indexes:
> - v2 (default): https://developers.clearpay.co.uk/v-2/llms.txt
> - v1: https://developers.clearpay.co.uk/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.clearpay.co.uk/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.clearpay.co.uk/_mcp/server.

# Hooks

## Product Eligibility

The Clearpay plugin runs a series of checks to determine whether Clearpay should be an available payment option for each individual product. Third-party plugins can exclude Clearpay from products that would otherwise be considered supported. This can be done by attaching to the following filter hook:\
`clearpay_is_product_supported`

Example:

```php
/**
 * @param bool		$bool_result
 * @param WC_Product	$product
 */
function clearpay_ips_callback( $bool_result, $product ) {
	# My custom products don't support Clearpay.
	if ($product->get_type() == 'my-custom-product-type') {
		$bool_result = false;
	}
	return $bool_result;
}
add_filter( 'clearpay_is_product_supported', 'clearpay_ips_callback', 10, 2 );
```

## Display on Individual Product Pages

Third-party plugins can also filter the HTML content rendered on individual product pages using the following filter hook:\
`clearpay_html_on_individual_product_pages`

\*Note: This is intended for altering the HTML based on custom, varying criteria.\
For setting the default HTML, use the admin interface under:\
"WooCommerce > Settings > Checkout > Clearpay".\
For hiding the HTML for a subset of products, consider using the following filter hook: `clearpay_is_product_supported`

Example:

```php
/**
 * @param string	$str_html
 * @param WC_Product	$product
 * @param float		$price
 */
function clearpay_hoipp_callback( $str_html, $product, $price ) {
	# Show a different message for products below a custom threshold.
	# Note that this will only be called if the product price is within
	# the payment limits defined at the account level.
	if ($price < 10.00) {
		$str_html = "<p>Shop Now, Pay Later with Clearpay. Supported for orders over $10.00</p>";
	}
	return $str_html;
}
add_filter( 'clearpay_html_on_individual_product_pages', 'clearpay_hoipp_callback', 10, 3 );
```

## Display on Category Pages and Search Results

To filter the HTML content rendered on category pages and search results, use the following filter hook:\
`clearpay_html_on_product_thumbnails`

\*Note: This is intended for altering the HTML based on custom, varying criteria.\
For setting the default HTML, use the admin interface under:\
"WooCommerce > Settings > Checkout > Clearpay".\
For hiding the HTML for a subset of products, consider using the following filter hook: `clearpay_is_product_supported`

## Display on the Cart Page

To filter the HTML content rendered on the cart page, use the following filter hook: `clearpay_html_on_cart_page`

## Display at the Checkout

To filter the HTML content rendered at the checkout, use the following filter hook: `clearpay_html_at_checkout`

## Customising Hooks & Priorities

As discussed in the section entitled ‘Theme Support’ above, various WooCommerce hooks are assumed to be implemented by the active WordPress theme. Clearpay methods can be detached from their default hooks and reattached to different hooks, or to the same hooks with different priorities.

Example 1 - Increase the priority of display on category pages:

Since version 2.1.0, hooks and priorities can be customised from within the plugin settings page.

![](file:docs/assets/images/9124514-Screen_Shot_2019-10-31_at_9.42.32_am.png "Screen Shot 2019-10-31 at 9.42.32 am.png")