Hello there,
* Regarding wc-product-functions.php You can refer to:
https://woocommerce.github.io/code-reference/files/woocommerce-includes-wc-product-functions.html
* Regarding the object returned by the function please refer to:
https://woocommerce.github.io/code-reference/files/woocommerce-includes-wc-product-functions.html#source-view.63
May I ask is there any reason to call the function with a negative number as a parameter? That will help us to provide better assistance.
Let us know.
Thread Starter
kayart
(@kayart)
Hello @ihereira
There’s no real reason to call the function with a negative function. I was curious what the function would return if a negative number was passed as an argument.
If you call wc_get_product() with an array or a string, it returns a boolean false, and this makes sense. So I expected that calling the function with a negative number would return false too, but it returns a product that doesn’t exist.
Hi @kayart
There’s no real reason to call the function with a negative function. I was curious what the function would return if a negative number was passed as an argument.
Ah I see thanks noted!
I think there is no further action required here now.
If you have any other questions, do not hesitate to let us know!