How to add something on the description product tab on the bottem (hook?)

This topic has 9 replies, 2 voices, and was last updated 1 months ago ago by Andrew Mitchell

  • Avatar: Nancy
    Nancy
    Participant
    October 31, 2025 at 15:31

    Maybe a silly question, but here it goes:

    I want to add something on each product page, but on the product description tab, on the bottom.
    It might be an attribute or a shortcode, I’m not sure yet.
    How can I achieve this? Is there a hook for this? Or am I thinking too difficult
    https://prnt.sc/1GtfdWnncluo

    Kind regards,
    Nancy

    8 Answers
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    October 31, 2025 at 17:32

    Hello,

    Thank you for your question.

    Unfortunately, your screenshot does not work.

    Could you please provide a link to your website and temporary access to the admin panel so that we can check your current settings?

    Best regards,
    8Theme’s Team

    Avatar: Nancy
    Nancy
    Participant
    November 3, 2025 at 15:26

    Here you go!

    I have whitelisted the same IP address as last time, if this is not the correct one, please let me know.

    https://www.bakgoed.nl/product/funcakes-mix-voor-biscuit-500-gram/

    Mobile view > Tabs > I want to place the EAN and or MPN on the bottom of that tab.

    Thanks in advance & Kind regards,
    Nancy

    Please contact administrator
    for this information.
    Files is visible for topic creator and
    support staff only.
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    November 3, 2025 at 18:19

    Hi there!

    Thanks for using XStore.

    We’ve reviewed your request and it requires custom development, which is outside Envato’s support policy. To get it done properly and on time, please submit it to our trusted partner WP Kraken:

    You’ll get:

    – fast quote & timeline
    – turnkey implementation by a vetted team
    – warranty on delivered work

    We’re confident this will help—hope you can make use of it shortly.

    Please contact administrator
    for this information.
    Avatar: Nancy
    Nancy
    Participant
    November 4, 2025 at 09:24

    Hello Andrew,
    Thank you for looking into this for me!
    I just wanted to know so I know I’m not reinventing the wheel or using something that’s a setting instead 😉

    If I made it work I’ll post the snippet here as usual.

    Kind regards!
    Nancy

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    November 4, 2025 at 11:56

    Hello,

    You’re very welcome!
    That sounds great — thank you for double-checking and for sharing your snippets with the community, it’s always helpful for other users as well.

    Warm Regards,
    The 8Theme Team

    Avatar: Nancy
    Nancy
    Participant
    November 4, 2025 at 11:57

    No problem, this is what I’ve come with so far:

    add_filter( 'woocommerce_product_tabs', function( $tabs ) {
        if ( isset( $tabs['description'] ) ) {
            $original_callback = $tabs['description']['callback'];
    
            $tabs['description']['callback'] = function( $key, $tab ) use ( $original_callback ) {
                global $product;
    
                // Toon eerst de standaard beschrijving
                call_user_func( $original_callback, $key, $tab );
    
                // Haal EAN en MPN op
                $ean = $product->get_meta( '_global_unique_id' );
                $mpn = $product->get_attribute( 'pa_inkoopcode' );
    
                if ( $ean || $mpn ) {
                    echo '<div class="ean-mpn-extra" style="margin-top:15px;">';
                    if ( $ean ) {
                        echo '<p><strong>EAN:</strong> ' . esc_html( $ean ) . '</p>';
                    } elseif ( $mpn ) {
                        echo '<p><strong>MPN:</strong> ' . esc_html( $mpn ) . '</p>';
                    }
                    echo '</div>';
                }
            };
        }
        return $tabs;
    });
    Avatar: Nancy
    Nancy
    Participant
    November 4, 2025 at 11:58

    Ofcourse I use a different attribute for the MPN, but you can customize it to your own meta or attribute field values

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    November 4, 2025 at 12:28

    Hello,

    Thank you for your cooperation

    Warm Regards,
    The 8Theme Team

  • Viewing 9 results - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.