• Resolved harf4ng

    (@harf4ng)


    Hi,

    Is there a way to display the “Description” tab even if it is empty?
    As I use php in description.php file to have a description display of my products, using custom fields, but then if the description box is empty, the description tab disappears, and therefore I cannot see my content.

    So any way to always have the description tab?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Claudiu Lodromanean

    (@claudiulodro)

    Lot of useful code snippets here for that sort of stuff: https://docs.woocommerce.com/document/editing-product-data-tabs/

    Thread Starter harf4ng

    (@harf4ng)

    I didn’t see a snippet that will allow me to display even an empty tab.
    So what do you think I should do? Create a custom tab, and instead of using the description tab, using this one?
    I would prefer using the description tab if this is possible though.

    Or I should use the custom function and put my code there instead of in the description.php ?

    Thanks

    • This reply was modified 6 years, 9 months ago by harf4ng.
    Thread Starter harf4ng

    (@harf4ng)

    Ok I have found a way to do it.
    In my custom tab.php file, instead of using the default $tabs management which uses the apply_filters method, I create manually my two entries of $tabs, with “description” and “additional information” tabs, the way they are defined when those tabs are not empty.

    After that, I let the remaining of the tabs.php display those tabs they way they should be.

    This way those tabs always display even without information.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Always display the description tab even if empty’ is closed to new replies.