SKU on Products Page - by intelisystems - on WordPress WooCommerce support

This topic has 12 replies, 5 voices, and was last updated 10 years, 2 months ago ago by Eva Kemp

  • Avatar: intelisystems
    intelisystems
    Participant
    September 25, 2015 at 20:00

    Hi,

    I would like show SKU for each product on Products Page, between product thumbnail and product name.

    How can I do so?

    Please, contact administrator
    for this information.
    11 Answers
    Avatar: Robert Hall
    Robert Hall
    Participant
    September 26, 2015 at 09:57

    Hello,

    If you want add SKU to shop page, you only need to add this code to the bottom of your child theme’s functions.php file.

    /* Adding SKU to shop page */
    add_action( 'woocommerce_after_shop_loop_item', 'prima_custom_shop_item', 5);
    function prima_custom_shop_item() {
    	global $post, $product;
    	
    	/* product sku */
    	echo '<p>SKU: '.$product->get_sku().'</p>';
    }

    Regards,
    Robert Hall.

    Avatar: intelisystems
    intelisystems
    Participant
    September 26, 2015 at 14:16

    Hi.

    Thank so much for your reply.

    I am sorry that I cannot usnderstand what you mean exactly.
    What do you mean by child theme’s functions.php?
    I am not using Child Theme now.

    I would appraciate where I have to go to find child theme’s functions.php.

    Regards,

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    September 28, 2015 at 11:41

    Hello,

    Child theme folder is included in the theme package that you downloaded. Please check it. Upload the folder to wp-content/themes directory and then activate child theme in Appearance > Themes.

    Best regards,
    Jack Richardson.

    Avatar: intelisystems
    intelisystems
    Participant
    September 28, 2015 at 19:38

    Hi,

    Thank you so much for your kind reply.

    It is working and SKU is show on Products page now but I would like to change the place.
    Currently, SKU is shown unser the Price.
    I would like to show SKU under product thumbnail and above the product name.
    What am I supposed to do?

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    September 29, 2015 at 11:12

    Hello,

    Did you remove the code?
    I see SKU number only in products titles now.

    Best regards,
    Jack Richardson.

    Avatar: intelisystems
    intelisystems
    Participant
    September 29, 2015 at 15:59

    Hi,

    I added the code again.

    How to place SKU under the thumbnail picture and above the product name?

    Regards,

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    September 29, 2015 at 16:56

    Hello,

    In order to achieve this you need edit the file wp-content/themes/woopress/woocommerce/content-product.php and add the code <?php echo '<div class="sku">' . $product->sku . '</div>'; ?> in line 94 before this code <?php if (etheme_get_option('product_page_productname')): ?>

    Best regards,
    Jack Richardson.

    Avatar: intelisystems
    intelisystems
    Participant
    October 9, 2015 at 22:18

    Hi,

    SKU is showing as I wanted.
    Thank you so much for your help.

    Can I ask you one more question?
    How do I manage font size of SKU?
    Currently font of SKU is a liitle smaller than thr product name.
    I would like to make them in same size.

    Avatar: stan
    Stan Russell
    Participant
    October 10, 2015 at 07:29

    Hello intelisystems,

    please add following css code to custom.css:

    .single-product .sku_wrapper {
    font-size:16px
    }

    You may use other value for font size if needed.

    Regards,
    Stan Russell.

    Avatar: intelisystems
    intelisystems
    Participant
    October 10, 2015 at 14:31

    Hi. Thank you for your answer.
    I tried but it is not working yet.

    I was able to show SKU under the thumbnail picture and above the product name by the instruction to
    edit the file wp-content/themes/woopress/woocommerce/content-product.php and add the code

    <?php echo ‘<div class=”sku”>’ . $product->sku . ‘</div>’; ?> in line 94 before this code <?php if (etheme_get_option(‘product_page_productname’)): ?>

    I want to change size of this font now.

    Avatar: Eva
    Eva Kemp
    Participant
    October 12, 2015 at 11:42

    Hello,

    Please add this code in child style.css:

    .sku {
        font-size: 15px;
    }

    Regards,
    Eva Kemp.

  • Viewing 12 results - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.