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.
This topic has 7 replies, 2 voices, and was last updated 1 weeks, 2 days ago ago by Kulimary
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.
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
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
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
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.
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
Thanks for the support! My topic “How to add EAN code under SKU in single product page?” has been successfully resolved.
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