skip to Main Content

Required Action Hooks and Filters

The Compare Products with WooCommerce plugin embeds content in several areas in order for everything to work correctly. It relies on content hooks provided by the WooCommerce template files to add the compare buttons and preview box. Issues may arise when using a third party theme as themes have the ability to override these templates. While it is strongly discouraged to remove these hooks from template files, you may run into a problem where your theme has removed a hook that is a necessity to this plugin. Below is a list of required hooks and the template file where they can be found. If any content from this plugin is not appearing, please check these locations and ensure the hooks are still there.


Action Hook Template File Location
woocommerce_before_shop_loop archive-product.php
woocommerce_after_shop_loop archive-product.php
woocommerce_after_shop_loop_item content-product.php
woocommerce_before_single_product content-single-product.php
woocommerce_single_product_summary content-single-product.php
get_footer footer.php (found in the root directory)
wp_footer footer.php (found in the root directory)
the_content page.php OR a custom template file if chosen in your page settings (found in the root directory)

* NOTE: Unless otherwise noted, the files above can be found in the ‘woocommerce’ folder of your theme’s directory

  • Was this article helpful ?
  • yesno
0 out of 0 visitors found this article helpful
Views: 61
Back To Top