Hi I am using Avada theme I created a child theme, I have woocommerce installed as well. I am having an issue where the sku number for the product won't display on the thumbnail and it wont display on the products page. It does not appear when I look at the item in the cart either. How can I fix this functionality to work in all three areas? The website I am having problem with is http://www.mabridalplus.com/?product_cat=baby-collection

I got it showing up in the cart by adding

add_filter( 'woocommerce_in_cart_product_title', 'add_sku_in_cart', 20, 3);

function add_sku_in_cart( $title, $values, $cart_item_key ) {
  $sku = $values['data']->get_sku();
  return $sku ? $title . sprintf(" (SKU: %s)", $sku) : $title;
}

to my functions.php but still need to figure out the other two.

I fixed the thumbnail not displaying the sku number by adding this code to my themes functions.php file. I just need to figure out how to add code for the products single page and I am good to go!

add_action( 'woocommerce_after_shop_loop_item_title', 'shop_sku' );
function shop_sku(){
global $product;
echo '<span itemprop="productID">SKU: ' . $product->sku . '</span>';
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.