0

Does anyone know how to display the SKU for each Single product title, underneath the Group product? I want to display the SKU to be obvious,as a second line,right below each product of the group.

enter image description here

enter image description here

3 Answers 3

1

Try with the CODE below:

global $woocommerce , $product;
$sku = $product->get_sku();
echo $sku;
1
  • 1
    Hi Karan, welcome to WPSE. I've edited your answer with proper formatting. Please check this post to learn more about Markdown syntax used in StackExchange sites. Also, it's better for everyone if you also add some explanation with the CODE. Like where to put this CODE, which part of the problem does it solve and how etc. Hope to see you more in WPSE.
    – Fayaz
    Commented Apr 17, 2019 at 7:34
0

I want to show the sku coe below from any title in grouped child products.

Where to put that code? In functions.php?

0

Try the code below in functions.php:

function wc_show_sku_grouped_product($value, $grouped_product_child){

global $product;

$sku = $product->get_sku();

if(!empty($sku)){

    $value .= "<div><strong>".__( 'SKU:', 'woocommerce' )." ".$sku."</strong></div>";

}

return $value;

}

add_filter('woocommerce_grouped_product_list_column_label', 'wc_show_sku_grouped_product', 10, 2);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.