Public Ticket #1085825
Can't display SKU


  •  2
    Andrzej started the conversation


    I want to show (I need to, to be honnest) SKU number at every single product page. I can't find this option. I hope you might help.

  •  192
    Nico replied

    Hi there,

    There isn't a default option for that and you will have to do it as a customization, maybe these articles can help you:



  • Rob replied

    I managed to show this on Ocin theme by altering the following file;

    ../ocin/inc/theme-functions/woo commerce_support.php

    from line 468.

     * HTML wrap end for Single page summary
    function ocin_single_product_wrap_end_summary(){
    global $product;

    if( $product->get_sku() ){
    <p class="ocin_sku" style="display: none;"><?php echo esc_html__( 'SKU:', 'ocin' ) . ' ' . esc_html( $product->get_sku() ); ?></p>
    <?php }  ?>
    <div class="variations_button_entry">
                <?php woocommerce_template_single_add_to_cart(); ?>

    <!-- /ADDED BY RK -->

    <div class="product_meta">

    <?php do_action( 'woocommerce_product_meta_start' ); ?>

    <?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : ?>

    <span class="sku_wrapper"><?php esc_html_e( 'SKU:', 'woocommerce' ); ?> <span class="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : esc_html__( 'N/A', 'woocommerce' ); ?></span></span>

    <?php endif; ?>

    <?php do_action( 'woocommerce_product_meta_end' ); ?>


    <!-- /ADDED BY RK -->

    Added style to -->> class="ocin_sku" style="display: none;"

    Then added everything between my <!-- /ADDED BY RK --> tags.

    Seems to work ok.

    Trying to work out how to show the SKU in the cart now....  there goes another 5 hours of my life....

    Hope this helps you out!

    if you work out how to get the variant SKU to show in the cart and checkout area let me know!!!!!



    Attached files:  Screen Shot 2017-05-18 at 23.53.47.png

  • Rob replied


    Show variant SKU in the cart with this code at line 62

    <div class="product_text">
    <div class="product_text_left">
    if ( ! $product_permalink ) {
    echo apply_filters( 'woocommerce_cart_item_name', $_product->get_title(), $cart_item, $cart_item_key ) . ' ';
    } else {
    echo apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $_product->get_title() ), $cart_item, $cart_item_key );

    <!-- ADDED RK -->
    <?php echo '<p>'.$_product->get_sku().'</p>'; ?>
    <!-- ADDED RK -->

    I only added the code between my <!-- /ADDED BY RK --> tags.

    Will need css styling though



  • Rob replied

    works in mini-cart.php as well.


    Will need css styling though



    Attached files:  Screen Shot 2017-05-19 at 00.44.59.png

  • Rob replied

    I will give the wishlist and other pages a crack tomorrow as it is 1am here now in England.



  • Rob replied

    hero colour change is done in this file:


    as the front end "customise" page doesn't always pick every link up.

  • Rob replied