Home Forums WoodMart support forum Product SKU

Product SKU

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #337513

    Charisis
    Participant

    Hello,
    i want to add SKU on shop page beneath the product title. Can you help me ?
    Also can i somehow search only a dedicated product code, i mean if i search the NK-21. It will appear only this and not the NK-210.

    Thanks!

    #337687

    Luke Nielsen
    Keymaster

    Hello,

    In order to display the “SKU” beneath the title on the shop page, try to add this code to the functions.php file in your child theme.

    if ( ! function_exists('wd_sku_under_title_on_loop') ) {
        function wd_sku_under_title_on_loop()  {
            global $product;
            $sku = $product->get_sku();
    
            if ( $sku ) {
                echo '<span class="product-grid-sku"><span>SKU: </span>' . $sku . '</span>';
    
            }
        }
    
        add_action( 'woocommerce_shop_loop_item_title', 'wd_sku_under_title_on_loop', 15 );
    }

    The search shows all similar queries.

    Kind Regards

    #337707

    Charisis
    Participant

    Thank you, that worked perfect!
    Also can I somehow add a space between sub-categories and products on shop page ?

    Thank you once again.

    #337787

    Luke Nielsen
    Keymaster

    Hello,

    Unfortunately, we can’t separate products and subcategories because you have enabled the “Show subcategories & products” option that accommodates it in one section.

    https://prnt.sc/21d8gcp

    The best way is to use only the “Show subcategories” option that divides subcategories and products into different pages.

    https://prnt.sc/21d97ft

    Kind Regards

    #337859

    Charisis
    Participant

    Okay, thank you!

    #337967

    Luke Nielsen
    Keymaster

    Hello,

    Let us know if there’s anything else we can do for you! You can always reach us at any time.

    Wish you all the best.

    Kind Regards

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Product SKU’ is closed to new replies.