Comment obtenir un ID de produit par SKU dans 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