Support

Account

Home Forums ACF PRO Getting WC product SKU from relationship field Reply To: Getting WC product SKU from relationship field

  • Figured it out 🙂

    $product_id = $p->ID;
    $product = wc_get_product( $product_id );
    echo $product->get_sku();

    Find the post/product ID inside the loop, look for the SKU.

    I did notice however that it spits out all the data about the product, which doesn’t seem very optimised? Would there be any way to only get the SKU without getting the whole product data?