15 1 0 4000 1 https://codeblock.co.za 300 true 0

get_id()

0 Comments

Framework / CMS

WooCommerce [Version: Since 2.6.0]

Syntax

Typical Usage

Gets and returns the product ID for a given WooCommerce product.


Accepted Parameters

none

Return Value(s)

Returns the product ID as an integer.

Examples of get_id()

Example 1

<?php
$product = wc_get_product($item);
$id = $product->get_id();

Was This Helpful?

Previous Post
wc_get_product_id_by_sku()
Next Post
update_meta_data()

0 Comments

Leave a Reply