The solution was simple, in the end. After grabbing the item ID, I had to query the product class:
$productmeta = new WC_Product($id);
$sku = $productmeta->post->sku;
Then insert $sku instead of $id on the output. It took me about 30min to figure that out. Perhaps it’ll be useful to someone else in the future. I placed the final code on Pastebin.
Related Posts:
- I Want to Get A Plugin Version Number Dynamically
- How do i know the current post type when on post.php in admin?
- Are there procedures to prevent malicious plugin updates?
- Page Templates from plugin not working after upgrading WP to 4.7 or upper version
- How to generate expiring URL?
- Avoiding plugin name collisions with WP updater
- Using standard backend elements in Plugin
- How to display variable prices by default in woocommerce?
- Remove update messages for deactivated plugins
- What happened to convertEntities?
- Can WordPress handle these functionalities?
- pre_set_site_transient_update_plugins wont call on hosted webspace
- wp_schedule_single_event function not working
- post_content getting cut off on blank space on $wpdb->update
- Is there a plugin to display certain posts on certain pages? [closed]
- Custom Shipping method not showing in checkout
- REST-API: extend media-endpoint
- Put code into body tags near top, using a plugin
- How to get popular post from across a network?
- Seaweed Plugin not working
- Can I share predefined fonts from theme_support with a gutenberg component?
- Where does WordPress register default scripts like jQuery?
- Is it possible to enqueue CSS files from plugin before theme’s CSS files?
- Front End Plugin for User Management [closed]
- Determine Registered Admin Menus
- wp_trash_post is leaking memory
- Implement Autocomplete for a custom field on WordPress Plugin Frontend
- Error “preg_match_all” with WordPress SEO by Yoast plugin [closed]
- Plugins Page invisible / white
- Inserting external image in WordPress plugin to track the plugin instalation [closed]
- How can I fix the mixed content problems of the kk star ratings plugin?
- WordPress + PHP + IIS + PHP Fatal error: require():
- Custom plugin init action causing general slowness
- Programatically update non-wordpress repository hosted (self-hosted) plugins
- Malware installation during plugin update?
- Plugin init hook fires repeatedly
- Is there any hook for theme activation ? or something similar?
- register_activation_hook in oop approach
- Can free plugin on WordPress.org site promote pro-version of this plugin?
- Add script into front from my plugin
- Meta box losing its value when scheduled post is published
- Full list of registered scripts or styles, but from an admin options page
- Why is the ‘Gutenberg’ Plugin generating an ‘Inconsistent File Permissions’ error when other Plugins, with the same permissions, do not?
- Disable Plugin with one button
- Exact Hook to payment methods
- Using wordpress translations strings in plugin
- Are mu-plugins plugins still deployed via wordpress.org/plugins?
- How to make my blog available to other website using RSS feed?
- how to insert a HTML form into a javascript popup?
- How can I modify page content in the admin panel?
- WordPress programming video tutorials [closed]
- WordPress front end AJAX. Return 0 :?
- WordPress 5.4 – How to prevent to enter only certain values in custom field
- Displaying content based on drop-down menu selection sitewide
- DB Query not working in Plugin
- sending different email notification while registration based on user role
- WordPress Multi-Step Product Search
- Woocommerce Free shipping method [closed]
- Is there a way to remove plugins in dashboard – where you cannot identify the slug by the plugins name?
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Settings options not showing up on Sub Menu page in WordPress plugin
- Using Amazon Book Gallery Plugins in WordPress [closed]
- unregister a sidebar widget
- Could add_query_arg() redirect user to external site?
- Plugins to generate reflinks in WordPress
- How to make if statement in react plugin?
- How to add label/badge on bookable product based on their booking status
- Does anyone know why my SEO and title become one?
- save_post hook partly firing in update post
- Help to create function that changes name in the certificate of the sensei lms
- Get Shortcode output to database for static post_content
- After migrating with duplicator all scripts are still tied to old CDN
- How to prevent redoing get_posts queries and make results available to other scripts?
- strtotime not working
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- WP Job Manager Feature jobs from [job_dashboard] page [closed]
- Optimized PHP & WordPress settings for speed/performance?
- Speeding up WordPress on a Local Network
- how change my menu on submenu
- Using slightly modified widget
- How to add a meaningful link in plugin admin panel?
- WP internationalization not loaded
- How to set up php,javascript and css to allow for our finished product to be displayed within a page?
- jQuery loaded in wrong order for non-admin page views only
- Adding custom cron_schedule prior to wp_schedule_event
- Capturing POST data
- Advanced Custom Fields Plugin – not displaying images
- WP-PostRatings – how to make rating show up?
- Making plugin to use different table prefix cause permission problem
- wordpress Search function is not working
- Auto play audio using WP Maintenance Mode Plugin [closed]
- Plugin to allow for recurrent subscription + exclusive content
- How to automatically convert “normal” conditions to yoda conditions
- Woocommerce Large Variations Shows Out of Stock Items [closed]
- SSL not working for checkout
- Plugin LDAP Authentication 2 In stallation ploblem
- woocommerce how to get cat id in content-product.php
- How to use WP-reCAPTCHA on a form
- Mixed results with is_page() WordPress function, when using $this, or self
- I have created a custom plugin. After activation it creating page but i am not getting how to add another php file at page content?