Wordpress WooCommerce website in show product sku on all product category pages without using any wordpress plugin, Basically, it's hook function automatic directly connected with function page in wordpress child theme.
There wooCommerce plugin no SKU option available for you to add in the product category pages itself, so you can used this custom code on function page, it's custom code 100% working now display sku number after title in product categories pages.
WooCommerce SKU Show After Title All Product Category Pages
How do add product SKU under product name on category page WooCommerce
It's very simple trick for Wordpress website eCommerce in display sku on product all category pages, add following this code to functions.php in your child theme.Following steps for displaying sku numbers on all product categories pages
- Connect FTP your web server
- Always create child theme for woocommerce website
- Go to this path- /wp-content/themes/Child-themes/functions.php
- Open your child-themes in functions.php
- Add below custom code on functions.php
- Save file
- Upload file on path- /wp-content/themes/Child-themes/functions.php
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_after_shop_loop_item_sku_in_cart', 20, 1);
function woocommerce_after_shop_loop_item_sku_in_cart( $template ) {
global $product;
$sku = $product->get_sku();
echo "<p style='color: #444;'>" ."SKU Number: " . $sku . "</p>"; }
$sku = $product->get_sku();
echo "<p style='color: #444;'>" ."SKU Number: " . $sku . "</p>"; }