Viewing 1 replies (of 1 total)
  • Kris

    (@c0nst)

    Hi @gohelkunjan!

    By default, in WooCommerce, on the search results page, the product SKU is not displayed on the product tile. Here is a code snippet that will add this code under the product title.

    // Add SKU to the product tile on the products archive and search results page
    add_action( 'woocommerce_after_shop_loop_item_title', function () {
    	global $product;
    
    	if ( $product && $product->get_sku() ) {
    		echo '<span class="product-sku">' . esc_html__( 'SKU: ', 'woocommerce' ) . $product->get_sku() . '</span>';
    	}
    }, 10 );

    You have two ways to add this code to your theme:

    1. Open the functions.php in your child theme and add the code at the end.
    2. or install the?Code Snippets?plugin and apply this code as a snippet.

    Regards,
    Kris

Viewing 1 replies (of 1 total)
  • The topic ‘Sku through product not search’ is closed to new replies.