Hello, thank you for your response.
I thought that maybe there is an option to set this directly in the theme.
I ended up doing it via functions.php. Is this an okay approach? Here’s what I used:
/**
* Display SKU on the WooCommerce single product page (below the product title)
*/
add_action( 'woocommerce_single_product_summary', 'display_sku_below_title', 6 );
function display_sku_below_title() {
global $product;
// Exit if $product is not defined or not a valid WC_Product object
if ( ! is_a( $product, 'WC_Product' ) ) {
return;
}
// Get the product SKU
$sku = $product->get_sku();
// Only display if SKU exists and is not empty
if ( ! empty( $sku ) ) {
// Translatable label - WPML
$label = __( 'SKU', 'woocommerce' );
// Output
printf(
'<p class="product-sku" style="margin-bottom:10px;"><strong>%s:</strong> %s</p>',
esc_html( $label ),
esc_html( $sku )
);
}
}
brS