Catalog Modes - Filter Hook References

Modified on Thu, 9 Feb, 2023 at 11:48 PM

This is simply a list of catalog modes related filter hooks included in the WooCommerce Catalog Mode - Pricing, Enquiry Forms & Promotions files. This list also includes the supported parameters and example codes.


wmodes-admin/catalog-modes/get-mode-type-groups

  • Parameters:
  • $group_types array()
  • $args array()


Example Codes:

function custom_get_mode_type_groups( $group_types, $args ) {

    //add your custom code here
    return $group_types;
}

add_filter( 'wmodes-admin/catalog-modes/get-mode-type-groups', 'custom_get_mode_type_groups', 10, 2 );

wmodes-admin/catalog-modes/get-{group_type_id}-mode-types

  • Parameters:
  • $mode_types array()
  • $args array()


Example Codes:

function custom_get_group_type_id_mode_types( $mode_types, $args ) {

    //add your custom code here
    return $mode_types;
}

add_filter( 'wmodes-admin/catalog-modes/get-{group_type_id}-mode-types', 'custom_get_group_type_id_mode_types', 10, 2 );

wmodes-admin/catalog-modes/get-mode-type-{mode_type_id}-fields

  • Parameters:
  • $fields array()
  • $args array()


Example Codes:

function custom_get_mode_type_mode_type_id_fields( $fields, $args ) {

    //add your custom code here
    return $fields;
}

add_filter( 'wmodes-admin/catalog-modes/get-mode-type-{mode_type_id}-fields', 'custom_get_mode_type_mode_type_id_fields', 10, 2 );

wmodes-admin/catalog-modes/get-type-requires-products

  • Parameters:
  • $mode_type_ids array()
  • $args array()


Example Codes:

function custom_get_type_requires_products( $mode_type_ids, $args ) {

    //add your custom code here
    return $mode_type_ids;
}

add_filter( 'wmodes-admin/catalog-modes/get-type-requires-products', 'custom_get_type_requires_products', 10, 2 );

wmodes-admin/catalog-modes/get-type-requires-variations

  • Parameters:
  • $mode_type_ids array()
  • $args array()


Example Codes:

function custom_get_type_requires_variations( $mode_type_ids, $args ) {

    //add your custom code here
    return $mode_type_ids;
}

add_filter( 'wmodes-admin/catalog-modes/get-type-requires-variations', 'custom_get_type_requires_variations', 10, 2 );

wmodes/catalog-modes/process-{mode_type_id}-mode

  • Parameters:
  • $mode array()
  • $mode_args array()
  • $data array()


Example Codes:

function custom_process_mode_type_id_mode( $mode, $mode_args, $data ) {

    //add your custom code here
    return $mode;
}

add_filter( 'wmodes/catalog-modes/process-{mode_type_id}-mode', 'custom_process_mode_type_id_mode', 10, 3 );


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article