> This page is for version v2 (default).
> 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.

# Advanced configuration

You can extend and customise the 'Clearpay Gateway for WooCommerce' plugin without changing any plugin code.

### Hooks

The Clearpay plugin runs a series of checks to determine whether Clearpay should be an available payment option for each product. Some third-party plugins can exclude Clearpay from products that should be supported. To fix this problem, attach the following filter hook:

`clearpay_is_product_supported`

For example, see line 12:

```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 );
```

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.

Since version 2.1.0, you can customise hooks and priorities from within the *Plugin Settings* page.

### Shortcodes

Shortcodes render an advanced `img` tag that displays the Clearpay logo on individual product pages. The `img` tag uses the `srcset` attribute to include three different logo resolutions for screens with varying pixel density ratios.

```html
[clearpay_product_logo]
```

There are three different themes of the logo to choose from:

* `colour`
* `black`
* `white`

The default logo theme is `colour`. To override it, include a `theme` attribute inside the shortcode. For example, if you have a dark themed website and want to use the white mono version of the Clearpay logo:

```html
[clearpay_product_logo theme="white"]
```