0

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

1
Contributor
2
Replies
14
Views
3 Years
Discussion Span
Last Post by nufftalon
0

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.

Edited by nufftalon

0

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>';
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.