1. Home
  2. Docs
  3. Compare Affiliated Products
  4. Developper
  5. Hooks

Hooks

In order to help developpers to make Compare Affiliated Products their own, I put some hooks, action and filter in the code.

Disclaimer

If I’ve forgotten ou you need an Hook somewhere, please contact me here

Actions

    • do_action( 'thfo_compare_after_price', $this );

      This hook fire in the AAWP Template to show the affiliated products

Filters

  • apply_filters( 'compare_partner_name', $p['partner_name'] )

    Allow you to filter the partners logo
    (../classes/class-awin.php#L236)

  • apply_filters( 'compare_currency_unit', $currency );

    Allow you to customize the currency unit or replace the letter code by the symbol.

    Example:

    add_filter( 'compare_currency_unit', 'thfo_customize_currency_symbol' );
    function thfo_customize_currency_symbol( $currency ) {
       return '€';
    }

    (../shortcode/class-compare-basic-shortcode.php#L26)

  • apply_filters( 'compare_settings_tab', $tabs );

    Allow you to add settings tabs
    (../admin/settings.php#L12)

  • apply_filters('compare_time_limit', 600);

     

    Example:

    add_filter( 'compare_time_limit', 'change_time_limit' );
    function change_time_limit( $secondes) {
       return 6000;
    }

    Allow you to increase PHP limit time in import and register infos.
    (../classes/class-awin.php#L56)
    (../classes/class-awin.php#L215)

  • $partners = apply_filters( 'compare_partners_code', array( 'Cdiscount'=> '6948', 'Toy\'R us' => '7108', 'Oxybul eveil et jeux' => '7103','Rue du Commerce' => '6901') );

    Allow you to customize logo & partner code before displaying
    (../classes/class-awin.php#L233)

  • Since 1.2.6
    $tracker  = apply_filters( 'compare_url_tracker', get_bloginfo('url') );

    Allow customizing the expression to track the URL. by default: the website URL

Was this article helpful to you? Yes No

How can we help?