18th January 2021
Framework / CMS
WooCommerce [Version: Since 2.3.0]
Gets the ID of a product using the SKU.
sku (string) (Required): The product SKU required for the lookup.
Return Value(s)Returns the product ID as an integer.
<?php $id = wc_get_product_id_by_sku(1234); $product = wc_get_product($id)
Used In Projects
Was This Helpful?
If this post has helped you, please let me know. Your feedback will be highly appreciated and will help me build better content.