I'm using YITH wishlist with Woocommerce. I want to have my wishlist display the SKU as well as the default items.
I was able to get the YITH plugin to show an option of "Show SKU" in the settings.
I can't figure out how to call up the SKU for output though.
Here is the code I have:
// Custom wishlist categories <?php if( get_option( 'yith_wcwl_stock_number_show' ) == 'yes' ) : ?> <td class="product-stock-number"> <?php echo $_product->get_sku(); ?> </td> <?php endif ?>
It produces the following error:
Fatal error: Call to a member function get_sku() on a non-object in /home2/cityrank/public_html/wp-content/plugins/yith-woocommerce-wishlist/templates/wishlist.php on line 145
I tried adding global $product; to the top of the page but that didn't work either.