WordPress.org

Ready to get started?Download WordPress

Forums

Virtue
Show SKU (8 posts)

  1. bertbert
    Member
    Posted 3 months ago #

    Does anyone know how to make the SKU display with the woocommerce plugin?

    I've searched and couldn't find an answer.

  2. bertbert
    Member
    Posted 3 months ago #

    Anyone?

  3. belindablakley
    Member
    Posted 3 months ago #

    I'm trying to figure this out too. Woocommerce helpdesk said that their newest version displays the SKU under the Add to Cart button, but that the Virtue theme overrides it. I haven't figured it out yet though; I'll post back if I do.

  4. bertbert
    Member
    Posted 3 months ago #

    Thanks Belinda! The folks at Kadence Themes are usually quick to respond, so let's keep our fingers crossed.

  5. belindablakley
    Member
    Posted 3 months ago #

    I figured it out! Go to this file:
    wp-content/themes/virtue/woocommerce/single-product/meta.php

    and find this code:
    <?php do_action( 'woocommerce_product_meta_start' ); ?>

    After that line, add this code:
    `<?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : ?>

    <span class="sku_wrapper"><?php _e( 'SKU:', 'woocommerce' ); ?> <span class="sku" itemprop="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : __( 'n/a', 'woocommerce' ); ?></span>.</span>

    <?php endif; ?>`

    You may want to do this in a child theme or save it in another file, because it will get deleted with an update. But, maybe they will update the file to have this code anyway...

  6. Kadence Themes
    Member
    Theme Author

    Posted 3 months ago #

    Interesting, I'll update the theme, sorry about that missed that update with woocommerce. I will plan on just taking that file out of the theme.

    Thanks,

    Kadence Themes

  7. bertbert
    Member
    Posted 3 months ago #

    Thanks, that worked!

    Kadence Themes, thanks for the future update.

  8. belindablakley
    Member
    Posted 3 months ago #

    I'm glad I could help! Thanks, Kadence, for an excellent theme!

Reply

You must log in to post.

About this Theme

About this Topic