[Resolved] Hide weight on single product page

Home Forums Support [Resolved] Hide weight on single product page

Home Forums Support Hide weight on single product page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1014981
    _blank

    Hello,
    is there a way to hide only the weight on the single product page but keep the description in the product tabs?
    Thanks for the info πŸ™‚
    Best
    Hannah

    #1015123
    David
    Staff
    Customer Support

    Hi there,

    try this PHP filter snippet to unset that tab:

    add_filter( 'woocommerce_product_tabs', 'db_remove_product_tabs', 98 );
     
    function db_remove_product_tabs( $tabs ) {
        unset( $tabs['additional_information'] ); 
        return $tabs;
    }
    #1017305
    _blank

    Hello, thank you very much. I tried to admit with the plugin insert php but its not working. Unfortunately I always only add CSS and I don’t have any experience with PHP.
    Is there also a CSS or could you guide me to add the PHP filter?

    Thank you so so much

    All the best
    Hannah

    #1017341
    David
    Staff
    Customer Support

    We provide this guide on adding PHP:

    https://docs.generatepress.com/article/adding-php/

    The Code Snippets plugin is the one we recommend if you’re not using a child theme.

    #1017361
    _blank

    HI David,
    thank you so much. I used Code Snippets and it worked wonderful. The only thing: I DO have a child theme. What could be a problem or why would you only recommend it in case I am not using one?

    Thanks a lot πŸ™‚
    Best wishes
    Hannah

    #1017368
    David
    Staff
    Customer Support

    No problems if you have a child theme and the code snippets plugin.
    If you’re confident at editing the child themes function.php then you can have one less plugin. But the plugin bears no weight on the front end of the site so this is not an issue.
    My only word on using plugins to add code is if there are other admin users who could mistakingly disable the plugin or edit the code.

    #1017395
    _blank

    I understood. Thank you so much πŸ™‚

    #1017410
    David
    Staff
    Customer Support

    You’re welcome

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