Leo Product Recommendations: Upsell Popup, Frequently Bought Together & Cart Drawer for WooCommerce 3.7.0 has 19 actions and 39 filters, read directly from its source code on Nov 18, 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 Leo Product Recommendations: Upsell Popup, Frequently Bought Together & Cart Drawer for WooCommerce fires an action
add_action( 'lpr_popup_modern_summary', function() {
// Your code runs here.
}, 10, 1 );
// Change a value Leo Product Recommendations: Upsell Popup, Frequently Bought Together & Cart Drawer for WooCommerce is about to use
add_filter( 'lpr_ajax_add_to_cart_always', 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
-
/** * Keep adding single product forms with AJAX even when the popup limit is * reached or the popup is replaced (Pro cart drawer). */ apply_filters( 'lpr_ajax_add_to_cart_always', false ); -
/** * Filters a GA4 item in the lpr_popup_* dataLayer events. */ apply_filters( 'lpr_datalayer_item', $item, $product ); -
/** * Linked products shown in the popup for a product. */ apply_filters( 'lpr_linked_product_ids', $ids, $product_id ); -
/** * Grid or slider for a place. */ apply_filters( 'lpr_place_layout', 'slider' === $args['layout'] ? 'slider' : 'grid', $args ); -
/** * Filters recommendations made for several products together (cart, checkout, * thank-you page). */ apply_filters( 'lpr_place_recommendations', $map, $source_ids, $args ); -
/** * Load the places script on this page. Pro turns it on for its own places. */ apply_filters( 'lpr_places_load_assets', $this->cart_enabled() && $this->base->is_cart_or_checkout_page() && !is_checkout() ); -
/** * Show the after-reload popup on the cart and checkout pages too (for stores * that redirect to the cart after adding). Off by default. */ apply_filters( 'lpr_popup_after_reload_on_cart', false ); -
/** * Popup design: modern or classic. */ apply_filters( 'lpr_popup_design', $design ); -
/** * HTML of one product card in the modern popup. */ apply_filters( 'lpr_popup_modern_card_html', $html, $product ); -
/** * Inside the modern popup, under the added product (Pro: free shipping bar). */ do_action( 'lpr_popup_modern_summary' ); -
/** * The popup is shown with products. */ do_action( 'lpr_popup_shown', $product_id ); -
/** * Load tracking data for the popup products from a front-end request. On by * default when GTM4WP is active. */ apply_filters( 'lpr_popup_tracking_data', defined('GTM4WP_VERSION') ); -
/** * Smart recommendations (learned from the store's orders) are available. */ apply_filters( 'lpr_smart_available', false ); -
/** * Smart picks for a product, best first. */ apply_filters( 'lpr_smart_product_ids', array(), $product_id, $limit ); -
/** * Marker of themes that add the single product form to the cart with their own * AJAX call. Forms containing it are left to the theme. */ apply_filters( 'lpr_theme_ajax_add_to_cart_selector', '[data-add-to-cart="ajax"]' ); -
apply_filters( 'woocommerce_add_to_cart_validation', true, $product_id, $quantity, $variation_id, $variations ); -
do_action( 'woocommerce_ajax_added_to_cart', $product_id ); -
do_action( 'lpr_after_modal_content', $product_id, $recommended_products_id ); -
do_action( 'lpr_after_products_loop', $product_id, $recommended_products_id ); -
do_action( 'lpr_before_modal_content', $product_id, $recommended_products_id ); -
do_action( 'lpr_before_products_loop', $product_id, $recommended_products_id ); -
apply_filters( 'lpr_go_checkout', true ); -
apply_filters( 'lpr_show_close_icon', true ); -
apply_filters( 'lpr_show_continue_shopping', true ); -
do_action( 'flatsome_woocommerce_shop_loop_images' ); -
do_action( 'lpr_after_recommended_product', get_the_ID() ); -
apply_filters( 'lpr_ajax_add_to_cart_supported', $supported, $adding_to_cart, $add_to_cart_handler ); -
do_action( 'lpr_before_action' ); -
do_action( 'lpr_before_recommended_product', get_the_ID() ); -
apply_filters( 'lpr_cart_count', true ); -
apply_filters( 'lpr_cart_icon', '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path d="M23.76 4.248c-0.096-0.096-0.24-0.24-0.504-0.24h-18.48l-0.48-2.4c-0.024-0.288-0.384-0.528-0.624-0.528h-2.952c-0.384 0-0.624 0.264-0.624 0.624s0.264 0.648 0.624 0.648h2.424l2.328 11.832c0.312 1.608 1.848 2.856 3.48 2.856h11.28c0.384 0 0.624-0.264 0.624-0.624s-0.264-0.624-0.624-0.624h-11.16... ); -
apply_filters( 'lpr_cart_recommendations_enabled', $enabled ); -
apply_filters( 'lpr_checked_icon', '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path d="M256,0C114.84,0,0,114.84,0,256S114.84,512,256,512,512,397.16,512,256,397.16,0,256,0ZM385.75,201.75,247.08,340.41a21.29,21.29,0,0,1-30.16,0l-69.33-69.33a21.33,21.33,0,0,1,30.16-30.16L232,295.17,355.59,171.59a21.33,21.33,0,0,1,30.16,30.16Z"/></g></g></s... ); -
apply_filters( 'lpr_datalayer_item_id_type', 'id' ); -
apply_filters( 'lpr_datalayer_item_list_name', 'Product Recommendations Popup' ); -
do_action( 'lpr_end_modal_head', $product_id, $recommended_products_id ); -
apply_filters( 'lpr_feature_request_api_url', self::API_URL ); -
apply_filters( 'lpr_fix_price', ['Sneaker','Rey','Safira','Plantmore','Blocksy-type-2'] ); -
apply_filters( 'lpr_fix_thumb', ['DavinciWoo','Rey', 'Blocksy-type-2', 'Betheme'] ); -
apply_filters( 'lpr_popup_accent_color', $color ); -
apply_filters( 'lpr_popup_after_reload', true, $added_id, $product_id ); -
apply_filters( 'lpr_popup_datalayer', true ); -
apply_filters( 'lpr_random_pool_size', 500, $product_id ); -
apply_filters( 'lpr_recommended_products_id', $own, $product_id, $from ); -
do_action( "lpr_settings_field_{$type}", $field, $this->base, $this->base->get_settings_id() ); -
apply_filters( 'lpr_settings_pages', $pages, $this ); -
apply_filters( 'lpr_show_buttons', true ); -
do_action( 'lpr_start_modal_head', $product_id, $recommended_products_id ); -
apply_filters( 'lpr_title_price', ['Rey','Blocksy-type-2'] ); -
apply_filters( 'woocommerce_add_to_cart_fragments', array( 'div.widget_shopping_cart_content' => '<div class="widget_shopping_cart_content">' . $mini_cart . '</div>', ) ); -
apply_filters( 'woocommerce_add_to_cart_handler', $adding_to_cart->get_type(), $adding_to_cart ); -
do_action( "woocommerce_add_to_cart_handler_{$add_to_cart_handler}", false ); -
apply_filters( 'woocommerce_add_to_cart_product_id', absint(wp_unslash($this->data['product_id'])) ); -
do_action( 'woocommerce_after_add_to_cart_button' ); -
do_action( 'woocommerce_after_shop_loop_item_title' ); -
do_action( 'woocommerce_before_shop_loop_item_title' ); -
apply_filters( 'woocommerce_loop_add_to_cart_link', '<a href="#" class="lpr-tracking-probe"></a>', $item, array() ); -
do_action( 'woocommerce_shop_loop_item_title' );
Generated from Leo Product Recommendations: Upsell Popup, Frequently Bought Together & Cart Drawer 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: