WooCommerce2 / remove_actions for tabs not working (1 post)

  1. dalemoore
    Posted 2 years ago #

    I upgraded to WooCommerce 2.0, and the actions I had set up to remove tabs and shift the position of the attributes panel to a different area in the single product page are no longer working. I do not use the tabs or panels, except for the attributes panel, so I have no need for tabs. I used actions to remove all of them but the attributes panel. But with 2.0, this no longer works. Here is the code I used in my functions.php:

    // WooCommerce adjustments for the templates, etc.
    	remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); // Remove related products
    	remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10); // Remove sidebar
    		remove_action( 'woocommerce_product_tabs', 'woocommerce_product_attributes_tab', 20 ); // Remove attributes tab
    	remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40);
    	remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_attributes_panel', 20 ); // Switching the position of attributes
    	add_action( 'woocommerce_before_single_product_summary', 'woocommerce_product_attributes_panel', 20 );
    	remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10); // Remove price from default location, we are adding it into the template below
    	add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_price', 20 );
    	remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20);
    	remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
    	add_action( 'woocommerce_before_single_product', 'woocommerce_show_product_images', 20);
    	add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_thumbnails', 20 );
    	remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30 );
    	add_filter('widget_text', 'do_shortcode');

    On the single product page, it says something about the function no longer existing, which I found out what it meant by commenting out each of those lines up there one by one which it referred to.

    Similar issue is in this post but the post has been marked as resolved, and it only discusses adding tabs. I want to remove them selectively, while keeping the attributes panel w/o its tab. Possible again? Or only through filters? Thanks for the help!


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.