-
AuthorPosts
-
June 21, 2018 at 12:04 am #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
June 21, 2018 at 4:17 am #975642Hey 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,
IsmaelJune 21, 2018 at 4:44 am #975652Hi 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.
June 21, 2018 at 4:52 pm #975856Hi,
I’ve checked the site again. The code is I functions.php but the tab is still showing.
June 21, 2018 at 10:44 pm #976029Hi,
Take a look here
let us know if that does help at all.
Best regards,
BasilisJune 22, 2018 at 6:42 pm #976437Hi,
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, 5 months ago by Rgrant74.
June 23, 2018 at 12:33 pm #976928Hi 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,
VictoriaJune 24, 2018 at 1:28 am #977106add_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
June 25, 2018 at 1:02 am #977261Hi,
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,
IsmaelJune 25, 2018 at 1:50 am #977275Sorry if this is a silly question but are you asking me to remove the previous code or login?
June 25, 2018 at 2:02 am #977280Hi,
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,
IsmaelJune 25, 2018 at 4:33 am #977310Done!
June 25, 2018 at 5:54 am #977319Hi,
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,
IsmaelJune 25, 2018 at 5:37 pm #977577This reply has been marked as private.June 26, 2018 at 12:00 am #977705Hi,
Thanks for the update.
We placed the filter in the functions.php file. The additional informations tab should not be displayed now.
Best regards,
IsmaelJune 26, 2018 at 12:02 am #977706Thanks so much for your help Ismael. Can you tell me what was wrong or what I was doing wrong?
June 27, 2018 at 4:22 pm #978475 -
AuthorPosts
- You must be logged in to reply to this topic.