Skip to content

Instantly share code, notes, and snippets.

@woogists
Last active December 29, 2023 16:55
Show Gist options
  • Select an option

  • Save woogists/283ebce1fa16a98113c40bbbc10a96ae to your computer and use it in GitHub Desktop.

Select an option

Save woogists/283ebce1fa16a98113c40bbbc10a96ae to your computer and use it in GitHub Desktop.
[Theming Snippets] Remove related products output
@surya5353

Copy link
Copy Markdown

Still not working for me, I am using Woocommerce 3.8.0 and Avada 6.1.1... anyone had the same problem?

function remove_woo_relate_products(){
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
//remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
}
add_action('init', 'remove_woo_relate_products', 10);

@maniac-0s

Copy link
Copy Markdown

None of these examples works. Why do I need a plugin for every basic thing in wordpress so annoying

@midweste

midweste commented Oct 4, 2021

Copy link
Copy Markdown

For those that had probems with this working, you need to wait until woocommerce is loaded before you can remove this action as this action has yet to be added until a point later in the process

add_action('woocommerce_loaded', function () { remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); }, PHP_INT_MAX);

@AHmii079

Copy link
Copy Markdown

I developed a plugin based on this filter:

https://wordpress.org/plugins/remove-woocommerce-product-related/

If you can test, thank you;)

Thanks!

does work dude!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment