Cara Mendapatkan ID Produk oleh SKU di WooCommerce

$product_id = $wpdb->get_var(
    $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key='_sku' AND meta_value='%s'", $sku_name)
  );
//this code working in wordpress(woocommerce)
Mahmood Zamani Nemati