How to add EAN code under SKU in single product page?

This topic has 7 replies, 2 voices, and was last updated 1 weeks, 2 days ago ago by Kulimary

  • Avatar: Kulimary
    Kulimary
    Participant
    May 26, 2025 at 19:25

    Hello

    I want to add EAN to mage single product page.

    I tried applying the solution from this topic : https://www.8theme.com/topic/insert-eangtin-code-to-meta-in-product-page/

    But it has no affect at all
    Plz. help.

    6 Answers
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    May 27, 2025 at 07:51

    Dear @Kulimary,

    Thank you for reaching out.

    Could you please provide us with more details regarding your implementation? Specifically, we would appreciate it if you could share the code snippet you are using. Additionally, could you confirm whether you have set the GTIN value for the product during testing?

    We look forward to your response.

    Best regards,
    The 8Theme Team

    Avatar: Kulimary
    Kulimary
    Participant
    May 30, 2025 at 10:57

    I tried using this code but it had no effect (so i removed it from my function.php)

    add_action('woocommerce_product_meta_end', function() {
    	global $product;
    	$gtin = get_post_meta( $product->get_id(), '_gtin', true );
    	if ( $gtin == '') return;
    	?>
    	<span class="gtin_wrapper"><?php esc_html_e( 'GTIN:', 'xstore-child' ); ?> <span><?php echo $gtin; ?></span></span>
    	<?php
    });

    And yes my products does in fact have EAN codes setup we are using it to search for products via offical woocommerce app for inventory management purposes.

    See the attached screenshots

    Files is visible for topic creator and
    support staff only.
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    June 1, 2025 at 12:28

    Hello @Kulimary
    Please, try using next snippet and check the product meta then.

    add_action('woocommerce_product_meta_end', function() {
    	global $product;
    	$global_unique_id = $product->get_global_unique_id();
    	if ( $global_unique_id == '') return;
    	?>
    	<span class="global_unique_id_wrapper"><?php esc_html_e( 'Custom title:', 'xstore-child' ); ?> <span><?php echo $global_unique_id; ?></span></span>
    	<?php
    });

    Kind regards, Jack Richardson
    The 8theme’s team

    Avatar: Kulimary
    Kulimary
    Participant
    June 12, 2025 at 14:06

    Now it works great thank you,

    Mean time I noticed another problem i dont know if I should open a different ticket for it or not.

    Issue: When i set a product to backorder it has no effect at all. I have custome php. code line that allows me to have another “2nd stock” visible on ech product and i dont know if its interfering with it backorder setting.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    June 13, 2025 at 14:55

    Dear @Kulimary,

    Thank you for reaching out.

    Kindly create a separate topic for each of your questions to help us assist you more efficiently. Additionally, we would appreciate it if you could provide further details regarding the issues you are experiencing – such as screenshots or a video demonstration – related to the mentioned products.

    For troubleshooting purposes, we also recommend testing the functionality using the default Storefront theme with no additional plugins installed. This will help determine whether the issue is theme-related.

    Best regards,
    Jack Richardson
    The 8Theme Team

    Avatar: Kulimary
    Kulimary
    Participant
    June 16, 2025 at 11:31

    Thanks for the support! My topic “How to add EAN code under SKU in single product page?” has been successfully resolved.

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

The issue related to '‘How to add EAN code under SKU in single product page?’' has been successfully resolved, and the topic is now closed for further responses

Helpful Topics

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