U2Code Product Addons for WooCommerce 1.1.0 has 4 actions and 38 filters, read directly from its source code on Nov 19, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when U2Code Product Addons for WooCommerce fires an action
add_action( 'u2code_pa_fs_loaded', function() {
// Your code runs here.
}, 10, 1 );
// Change a value U2Code Product Addons for WooCommerce is about to use
add_filter( 'woocommerce_price_trim_zeros', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Filter the localized frontend data. */ apply_filters( 'woocommerce_price_trim_zeros', false ); -
/** * Filter a stored addon price into the active currency. */ apply_filters( 'u2code_pa/convert_price', $price, $priceType ); -
/** * This filter is documented in getUnitPriceAdjustment(). */ apply_filters( 'u2code_pa/entry_line_total', $price, $entry ); -
/** * This filter is documented in AddonRepository::sanitizeFields(). */ apply_filters( 'u2code_pa/price_types', array( 'flat', 'percent', 'qty', 'char' ) ); -
/** * Filter the addon uploads subdirectory. */ apply_filters( 'u2code_pa/upload_subdir', $subdir, $pathData ); -
/** * Filter whether the current user may see an addon group. */ apply_filters( 'u2code_pa/addon_visible_for_user', true, $addon ); -
/** * Build the entries for a field type this build does not price. An array (even * empty) is taken as handled. */ apply_filters( 'u2code_pa/build_field_entries', null, $field, $value, $label, $this ); -
/** * Filter whether a feature is available. */ apply_filters( 'u2code_pa/can_use_feature', $can, $feature ); -
/** * Filter the cart addon entries built from a submission. */ apply_filters( 'u2code_pa/cart_entries', $entries, $addons, $postData ); -
/** * Filter the data used to create a duplicated addon group. */ apply_filters( 'u2code_pa/duplicate_data', $data, $addon ); -
/** * Filter the "edit options" link shown on a cart line. */ apply_filters( 'u2code_pa/edit_link', $url, $cartItem, $cartItemKey ); -
/** * Filter whether frontend assets should load on the current page. */ apply_filters( 'u2code_pa/enqueue_assets', $needed ); -
/** * Filter an addon entry's display value in cart/order contexts. */ apply_filters( 'u2code_pa/entry_display_value', $display, $entry ); -
/** * Filter the view used to render an addon field. */ apply_filters( 'u2code_pa/field_template', $template, $field ); -
/** * Filter the available field types. */ apply_filters( 'u2code_pa/field_types', $types ); -
/** * Whether the field's conditional-logic rules leave it visible. */ apply_filters( 'u2code_pa/field_visible_by_rules', true, $field, $values ); -
/** * Filter the localized frontend data. */ apply_filters( 'u2code_pa/frontend_data', array( 'currencyOptions' => array( 'currency_symbol' => get_woocommerce_currency_symbol(), 'decimal_separator' => wc_get_price_decimal_separator(), 'thousand_separator' => wc_get_price_thousand_separator(), 'decimals' => wc_get_price_decimals(), 'price_format' => get_woocommerce_price_format(), 'trim_zeros' => apply_filters( 'woocommerce_price_trim_zeros', false ), ), ) ); -
/** * Filter the registered integrations. */ apply_filters( 'u2code_pa/integrations', array( new Woocs(), new Curcy(), new Aelia(), new Wpml(), new WooPayments(), new Wccs(), new TieredPricingTable( $cart, $calculator ), ) ); -
/** * Rebuild the measured extra (area, days) a premium type carries alongside its * value; false when the stored value no longer measures up, which drops the * entry. */ apply_filters( 'u2code_pa/rebuild_entry_extra', array(), $field, $value ); -
/** * Render a custom/unknown field type. */ do_action( "u2code_pa/render_field_{($field['type']??'')}", $field, $this ); -
/** * Filter the entries restored from a previous order. */ apply_filters( 'u2code_pa/reorder_entries', $visible, $storedEntries, $addons ); -
/** * Sanitized extra settings a feature adds to a field type it does not own * (e.g. multi-upload on File Upload). */ apply_filters( 'u2code_pa/sanitize_field_extras', array(), $field, $type ); -
/** * Sanitize the settings of a field type this build does not implement. Returns * the sanitized type-specific keys. */ apply_filters( 'u2code_pa/sanitize_field_settings', array(), $field, $type ); -
/** * Filter the frontend script dependencies. */ apply_filters( 'u2code_pa/script_dependencies', array( 'jquery', 'wp-i18n' ) ); -
/** * Skip a line whose price another plugin is already composing. */ apply_filters( 'u2code_pa/skip_cart_price_adjustment', false, (string) $cartKey, $cartItem ); -
/** * Filter whether addons render for a product. */ apply_filters( 'u2code_pa/supports_addons', $supported, $product ); -
/** * Filter whether a product may have its addons configured on an order. */ apply_filters( 'u2code_pa/supports_order_editing', $supported, $product ); -
/** * Filter the available storefront themes. */ apply_filters( 'u2code_pa/themes', $themes ); -
/** * Filter the computed unit price adjustment. */ apply_filters( 'u2code_pa/unit_price_adjustment', $adjustment, $entries, $basePrice, $quantity ); -
/** * Normalize a multi-upload $_FILES shape into a file list. The multi-file * feature provides this; with no provider the array shape yields no files. */ apply_filters( 'u2code_pa/uploaded_files', array(), $file, $field ); -
/** * Validate field types and checks this build does not implement. */ apply_filters( 'u2code_pa/validate_field', true, $field, $value, $label ); -
do_action( 'u2code_pa_fs_loaded' ); -
apply_filters( 'u2code_pa/addons_for_product', $matched, $productId ); -
do_action( 'u2code_pa/after_group', $addon, $product ); -
do_action( 'u2code_pa/before_group', $addon, $product ); -
apply_filters( 'u2code_pa/choice_limits', null, $field ); -
apply_filters( 'u2code_pa/field_logic', '', $field ); -
apply_filters( 'u2code_pa/positions', self::POSITIONS ); -
apply_filters( 'u2code_pa/upload_retention', $days * DAY_IN_SECONDS ); -
apply_filters( 'wc_aelia_cs_convert', $price, get_option( 'woocommerce_currency' ), get_woocommerce_currency() ); -
apply_filters( 'wpml_default_language', null ); -
apply_filters( 'wpml_object_id', $id, $type, true, $this->getDefaultLanguage() );
Generated from U2Code Product Addons for WooCommerce's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: