Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #975579

    I want to remove the addition information tab in woo and added this code (as per a previous thread on here) in functions.php:

    add_filter( ‘woocommerce_product_tabs’, ‘av_remove_product_tabs’, 98 );
    function av_remove_product_tabs( $tabs ) {
    unset( $tabs[‘additional_information’] ); // Remove the additional information tab
    return $tabs;
    }

    However when I do I get this error:

    Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.

    And any code I try to add gives me this error. Any idea how I can resolve this?

    I’ve included site details below for your reference. Thank you

    #975642

    Hey Rgrant74,

    Thank you for using Enfold.

    You have to edit the files on your cpanel or via FTP. Please ask your hosting provider to provide you with the correct FTP credentials. You can also generate that manually in your cpanel. The code works on my installation.

    add_filter( 'woocommerce_product_tabs', 'av_remove_product_tabs', 98 );
    function av_remove_product_tabs( $tabs ) {
    	unset( $tabs['additional_information'] );
    	return $tabs;
    }

    Best regards,
    Ismael

    #975652

    Hi Ishmael,

    I did speak with them and added the code via my cpanel. That was just after I posted this thread but I still see no change on my site. They mentioned thatt some themes don’t allow coding via WordPress-Appearance-Editor….is that the case with Enfold? Because every change I attempt to do that way gives me the previously mentioned error message.

    #975856

    Hi,

    I’ve checked the site again. The code is I functions.php but the tab is still showing.

    #976029

    Hi,

    Take a look here

    WooCommerce: Remove Additional Information Tab @ Single Product

    let us know if that does help at all.

    Best regards,
    Basilis

    #976437

    Hi,

    No this doesn’t really help. Like I said, I’ve added the code … there’s just no change. And I’d rather not add another plugin as I have several running already

    add_filter( ‘woocommerce_product_tabs’, ‘av_remove_product_tabs’, 98 );
    function av_remove_product_tabs( $tabs ) {
    unset( $tabs[‘additional_information’] ); // Remove the additional information tab
    return $tabs;
    }

    • This reply was modified 6 years, 6 months ago by Rgrant74.
    #976928

    Hi Rgrant74,

    You hade the wrong single quotes in there.
    Now it is

    woocommerce_product_tabs’
    

    it has to be

    
    'woocommerce_product_tabs'
    

    It will not work otherwise.

    Best regards,
    Victoria

    #977106

    add_filter( ‘woocommerce_product_tabs’, ‘av_remove_product_tabs’, 98 );
    function av_remove_product_tabs( $tabs ) {
    unset( $tabs[‘additional_information’] ); // Remove the additional information tab
    return $tabs;
    }

    Now gives me this on the website

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘‘av_remove_product_tabs’’ not found or invalid function name in /home2/thatchi4/public_html/stushlifestyle/wp-includes/class-wp-hook.php on line 286

    #977261

    Hi,

    Thanks for the update.

    The same filter works for my installation. Post the login login in the private field so that we can test the filter. Please remove the previous one.

    Best regards,
    Ismael

    #977275

    Sorry if this is a silly question but are you asking me to remove the previous code or login?

    #977280

    Hi,

    Remove the previous code or filter so that we can test it without causing a duplicate function error or something. Please post the WP and FTP login credentials in the private field. :)

    Best regards,
    Ismael

    #977310

    Done!

    #977319

    Hi,

    Thanks for the update.

    The FTP login details are not valid. Please check it carefully. Try this filter.

    add_filter( 'woocommerce_product_tabs', 'av_remove_product_tabs', 98, 1 );
    function av_remove_product_tabs( $tabs ) {
    	unset( $tabs['additional_information'] );
    	return $tabs;
    }
    

    It works on my installation.

    Screenshot: https://imgur.com/a/PzfKDJn

    Best regards,
    Ismael

    #977577
    This reply has been marked as private.
    #977705

    Hi,

    Thanks for the update.

    We placed the filter in the functions.php file. The additional informations tab should not be displayed now.

    Best regards,
    Ismael

    #977706

    Thanks so much for your help Ismael. Can you tell me what was wrong or what I was doing wrong?

    #978475

    Hi,

    The single quotes were converted to their hmtl entity code so it broke the filter. Did you copy the code from your email? You should copy the snippets directly from this forum.

    Best regards,
    Ismael

Viewing 17 posts - 1 through 17 (of 17 total)
  • You must be logged in to reply to this topic.