It’s recurrent: you want to easily find WooCommerce products ID. You can use products IDs in shortcodes and yes, that’s true when it comes to find a product ID some of you are lost, so i made this little plugin for you. Basically, the plugin will simply create a new column on the products list page that will show each product ID. Simple but useful!
Easily find WooCommerce products ID
20 responses to “Easily find WooCommerce products ID”
-
[…] Rémi propose une extension pour WooCommerce permettant d’identifier facilement les ID Produits (en). […]
-
[…] Rémi propose une extension pour WooCommerce permettant d’identifier facilement les ID Produits (en). […]
-
Hi Remi,
Please is this plugin available for download anywhere? If not, where should the code above be placed?
Thanks.
-
no, but you can simply create a new file containing that code and place it within the wp-plugins folder.
-
-
Works great with WordPress 3.6.1.
Also compatible with WPML. (Shows the correct product ID’s for all languages.)
-
Awesome! Thanks for the WPML feedback!
-
-
Hi Remi,
Is there anyway to check if a product is onsale or not? My ideas is to get an array of onsale IDs and check if the product ID is in the array. But it not a reaally optimized one.
Thanks,
-
Simply use the is_on_sale() function. For example $product->is_on_sale() will return true or false… quick and easy!
-
Hello Remi,
Thanh you very much for your help. It worked for me. Couldn’t find the function at Function Tab on Woocommerce website as it is located in Classes Tab
-
-
-
Works Fantastic. Thank you!
Is there a way to make this column sortable?-
yes, but it requires more code
-
-
Hi Remi,
I have got an error code for line 37 which is preventing me activating the plugin. Could you help me to fix it?
It says:
Parse error: syntax error, unexpected T_FUNCTION in /home1/harriet1/public_html/www.cheapwebdesignlondon.com/wp-content/plugins/WooProductID.php on line 37Thanks
harriet
-
Is it possible to check, if a submitted order contains a special product_id?
(To trigger a special email-text;
hook: ‘woocommerce_email_before_order_table’) -
Hello Remi,
Excellent blog…I became the fan of you. Great you and your post for woocommerce.
Many Thanks…Awesome
-
Thanks ! It’s much appreciated!
-
-
Hello Remi,
Is there any way to change the column position. I want to show my custom column before Date.
Please reply me.
-
Hi! Remi,
Thank you for this wonderful information. I’m new to wootheme and I have some something related product ID …
Could you help me out?
I’m trying to use perfect audience for retargeting. And with that I need to edit the tracking tag code …so here are my questions:
1) how do I manually input the tracking code . I need to manually insert that before the body tag in every page.
I did find this woodojo plug in
WooDojo Custom CSS/HTML
I need to make sure that it would install tracking code on every page.
2) I need to find the product id short code
And in your article I saw this code
“product_ID”
Is that what I need to use?
I basically need to use woo commerce product id short code in this tracking code from perfect audience
(function() {
window._pa = window._pa || {};
// _pa.orderId = “myOrderId”; // OPTIONAL: attach unique conversion identifier to conversions
// _pa.revenue = “19.99”; // OPTIONAL: attach dynamic purchase values to conversions
// _pa.productId = “myProductId”; // OPTIONAL: Include product ID for use with dynamic ads
var pa = document.createElement(‘script’); pa.type = ‘text/javascript’; pa.async = true;
pa.src = (‘https:’ == document.location.protocol ? ‘https:’ : ‘http:’) + “//tag.perfectaudience.com/serve/543d99cf14c4cd4b74000039.js”;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(pa, s);
})();Could you use your expertise to check for me if I have found the solution? Much appreciated
-
[…] So, I used my Google-Foo and came across Rami Corson’s website at https://www.remicorson.com/easily-find-woocommerce-products-id/ […]
-
[…] Så brugte jeg min Google-Foo og fandt Rami Corsons hjemmeside https://www.remicorson.com/easily-find-woocommerce-products-id/. […]
-
[…] Sie spielen beispielsweise bei der Verwendung in Shortcodes eine Rolle. Remi Corson hat ein kleines Plugin geschrieben, welches die Product ID als Spalte in der Produktübersicht von WooCommerce sichtbar […]
Leave a Reply
You must be logged in to post a comment.