add_action( 'woocommerce_single_product_summary', 'vanesis_display_cosmetic_details', 25 ); function vanesis_display_cosmetic_details() { global $product; // Παίρνουμε τις τιμές από WooCommerce / Google fields $brand = get_post_meta( $product->get_id(), 'brand', true ); $gtin = get_post_meta( $product->get_id(), '_wc_gla_gtin', true ); // νέο GTIN field του WooCommerce if ( empty( $gtin ) ) { $gtin = get_post_meta( $product->get_id(), 'ean_13', true ); // fallback στο παλιό ACF } $mpn = get_post_meta( $product->get_id(), 'mpn', true ); $condition = get_post_meta( $product->get_id(), 'condition', true ); // Αν δεν υπάρχουν δεδομένα, μην εμφανίζεις τίποτα if ( empty( $brand ) && empty( $gtin ) && empty( $mpn ) && empty( $condition ) ) { return; } echo '
Brand | ' . esc_html( $brand ) . ' |
GTIN / EAN-13 | ' . esc_html( $gtin ) . ' |
MPN | ' . esc_html( $mpn ) . ' |
Condition | ' . esc_html( ucfirst( $condition ) ) . ' |