Insert ean(GTIN) code to meta in product page

This topic has 5 replies, 2 voices, and was last updated 4 years, 8 months ago ago by pergolatios

  • Avatar: pergolatios
    pergolatios
    Participant
    October 13, 2020 at 17:41

    Hello guyz

    I’ve entered an other field in products(at backend), the GTIN number, where i will enter the EAN code. How can i show this in the front end?

    So how can i show this http://prntscr.com/uym0zk
    Here http://prntscr.com/uym1ls

    Thanks

    4 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    October 14, 2020 at 08:09

    Hello,

    Do you use an additional plugin?
    Provide temporary wp-admin access, so we can take a closer look.

    Regards

    Avatar: pergolatios
    pergolatios
    Participant
    October 14, 2020 at 09:14

    No, i dont use an additional plugin. I used some php to insert the new GTIN field

    Thanks

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    October 14, 2020 at 15:03

    Provide temporary FTP access, or add the next code in functions.php of your child theme:

    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
    });

    Regards

    Avatar: pergolatios
    pergolatios
    Participant
    October 16, 2020 at 13:47

    Ok issue solved, thanks

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

The issue related to '‘Insert ean(GTIN) code to meta in 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.