• Resolved nwdropship

    (@nwdropship)


    So I was trying to remove the “additional info” tab under a product in the Flatsome Woocommerce theme. I googled the code I would use to remove it. I also downloaded the plugin WPide so that I could attempt to even edit the code because I know nothing about coding. I pasted code that someone said would remove the additional info tab but it just showed up as code on the bottom of the page. So then I removed said code but now it says there’s a syntax error.

    error: Parse Error: Syntax error, unexpected EOF, expecting T_ENDIF on line 76

    The code I tried to paste below everything (oops?) was the following

    /**
    * @snippet Remove Additional Information Tab @ WooCommerce Single Product Page
    * @how-to Get CustomizeWoo.com FREE
    * @author Rodolfo Melogli
    * @testedwith WooCommerce 3.8
    * @donate $9 https://businessbloomer.com/bloomer-armada/
    */

    add_filter( ‘woocommerce_product_tabs’, ‘bbloomer_remove_product_tabs’, 9999 );

    function bbloomer_remove_product_tabs( $tabs ) {
    unset( $tabs[‘additional_information’] );
    return $tabs;
    }

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Remi Corson

    (@corsonr)

    Automattic Happiness Engineer

    Hi there,

    The snippet is actually correct, but it seems that you placed it within an if statement, that is probably why it’s failing. Also, when it comes to tabs edition, we usually suggest using this extension:

    https://woocommerce.com/products/woocommerce-tab-manager/

    Thread Starter nwdropship

    (@nwdropship)

    Thank you. So I tried simply removing the snippet but now the original code has a syntax error. How should I change the code (in the link for pastebin) so that it works and my product page works again??

    Remi Corson

    (@corsonr)

    Automattic Happiness Engineer

    Your snippet is outside the PHP tags that’s why it’s breaking: https://d.pr/i/WD6VjD

    it has to be within <?PHP ?> tags

    Thread Starter nwdropship

    (@nwdropship)

    Thank you! I also realized why when I deleted the code it was saying a syntax error. I had accidentally removed the <?php endif; ?> in front of the new code. So, should the code be like the following?

    <?php endif; add_filter( 'woocommerce_product_tabs', 'misha_remove_additional_information' );
     
    function misha_remove_additional_information( $tabs ) {
     
    	unset( $tabs['additional_information'] );
    	return $tabs;
     
    }?>
    Remi Corson

    (@corsonr)

    Automattic Happiness Engineer

    this should be good: https://d.pr/i/GxqkzS

    Thread Starter nwdropship

    (@nwdropship)

    I figured out how to do it without coding at all. When editing the attributes, you can unselect display on product page. If there are no attributes that “show on the product page” then there is nothing to display in the additional information tab.

    Remi Corson

    (@corsonr)

    Automattic Happiness Engineer

    Ha, yes, you’re totally right!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WPide Tabs Code causing error’ is closed to new replies.