For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomeGuidesAPI Reference
HomeGuidesAPI Reference
  • Introduction to Clearpay
    • Getting Started with Clearpay Online
    • Business Hub
    • Marketing Resources
  • Platforms
    • Platforms Quickstart
    • Adobe Commerce (Magento 2)
    • Adyen
    • Ecwid
    • Shopify
    • Stripe
    • Wix
    • WooCommerce
      • Advanced configuration
      • Frequently asked questions
      • Currency Conversion
      • Configure plugin
      • Hooks
  • API Development
    • API Quickstart
    • Test Environments
    • Certification
  • Clearpay Messaging
    • Getting Started
    • Implementation
    • Migration
    • Launch Clearpay Info Modal Anywhere
LogoLogo
On this page
  • Product Eligibility
  • Customising Hooks & Priorities
PlatformsWooCommerce

Hooks

This section describes the WordPress hooks used by the Clearpay WooCommerce integration.
Was this page helpful?
Previous

Aero Commerce

Next
Built with

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. To avoid this, attach to the following filter hook:

clearpay_is_product_supported

Example:

1/**
2 * @param bool $bool_result
3 * @param WC_Product $product
4 */
5function afterpay_ips_callback( $bool_result, $product ) {
6 # My custom products don't support Clearpay.
7 if ($product->get_type() == 'my-custom-product-type') {
8 $bool_result = false;
9 }
10 return $bool_result;
11}
12add_filter( 'clearpay_is_product_supported', 'clearpay_ips_callback', 10, 2 );

Customising Hooks & Priorities

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, hooks and priorities can be customised from within the plugin settings page.