15 1 0 4000 1 https://codeblock.co.za 300 true 0
theme-sticky-logo-alt

wc_get_product_id_by_sku()

0 Comments

Framework / CMS

WooCommerce [Version: Since 2.3.0]

Syntax

Typical Usage

Gets the ID of a product using the SKU.

Accepted Parameters

sku (string) (Required): The product SKU required for the lookup.

Return Value(s)

Returns the product ID as an integer.

Examples wc_get_product_id_by_sku()

Example 1

<?php
$id = wc_get_product_id_by_sku(1234);
$product = wc_get_product($id)

Was This Helpful?

Previous Post
get_attributes()
Next Post
get_id()

0 Comments

Leave a Reply