Get SKU to output on Wishlist (1 post)

  1. justinae
    Posted 2 years ago #

    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">
                                        echo $_product->get_sku();
                            <?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.



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic