Easily find WooCommerce products ID

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!

20 responses to “Easily find WooCommerce products ID”

  1. […] Rémi propose une extension pour WooCommerce permettant d’identifier facilement les ID Produits (en). […]

  2. […] Rémi propose une extension pour WooCommerce permettant d’identifier facilement les ID Produits (en). […]

  3. ese

    Hi Remi,

    Please is this plugin available for download anywhere? If not, where should the code above be placed?

    Thanks.

    1. no, but you can simply create a new file containing that code and place it within the wp-plugins folder.

  4. Stanislav

    Works great with WordPress 3.6.1.

    Also compatible with WPML. (Shows the correct product ID’s for all languages.)

    1. Awesome! Thanks for the WPML feedback!

  5. vitaminc1985

    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,

    1. Simply use the is_on_sale() function. For example $product->is_on_sale() will return true or false… quick and easy!

      1. vitaminc1985

        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

  6. hibbertmcgee

    Works Fantastic. Thank you!
    Is there a way to make this column sortable?

    1. yes, but it requires more code

  7. collectiveinds

    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 37

    Thanks

    harriet

  8. zemekys

    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’)

  9. akshay

    Hello Remi,

    Excellent blog…I became the fan of you. Great you and your post for woocommerce.

    Many Thanks…Awesome

    1. Thanks ! It’s much appreciated!

  10. akshay

    Hello Remi,

    Is there any way to change the column position. I want to show my custom column before Date.

    Please reply me.

  11. royalprincessko

    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

  12. […] So, I used my Google-Foo and came across Rami Corson’s website at http://www.remicorson.com/easily-find-woocommerce-products-id/ […]

  13. […] 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