Last active
December 29, 2023 16:55
-
-
Save woogists/283ebce1fa16a98113c40bbbc10a96ae to your computer and use it in GitHub Desktop.
[Theming Snippets] Remove related products output
None of these examples works. Why do I need a plugin for every basic thing in wordpress so annoying
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);
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
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);