Skip to content

Instantly share code, notes, and snippets.

@dennisnissle
Last active June 16, 2023 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dennisnissle/b901513cc5e721f88ff0e9cbc6efea64 to your computer and use it in GitHub Desktop.
Save dennisnissle/b901513cc5e721f88ff0e9cbc6efea64 to your computer and use it in GitHub Desktop.
Show GTIN and MPN as product attributes
<?php
add_action( 'woocommerce_product_additional_information', 'my_child_add_ean', 10 );
function my_child_add_ean( $product ) {
echo '<p>GTIN: ' . wc_gzd_get_gzd_product( $product )->get_gtin() . '</p>';
echo '<p>MPN: ' . wc_gzd_get_gzd_product( $product )->get_mpn() . '</p>';
}
@amafino
Copy link

amafino commented Jan 6, 2021

Wie und wo baue ich das updatesicher ein ?

@dennisnissle
Copy link
Author

functions.php des Child-Themes z.B.

@amafino
Copy link

amafino commented Jul 13, 2021

Leider funktioniert es nicht mehr
Auch in Console des Browser kann ich keine Ausgabe feststellen

@amafino
Copy link

amafino commented Jul 13, 2021

Muss eventuell dazu trusted shops aktiviert sein ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment