using woocommerce and before I would just use this code to have sku number show up on cart page. I would just add it in the functions.php
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;
}
Now I get this Fatal error: Call to a member function get_sku() on a non-object in
I updated both my theme and woocommerce to latest version and then it erased the custom codes.