This is my solution. I have found that this function (woocommerce_order_status_completed) is for when you made a payment or when you give completed status.
woocommerce_order_status_completed{
function check_quantity($order_id) {
global $wpdb;
$order = new WC_Order( $order_id );
$items = $order->get_items();
foreach ( $items as $item ) {
$product_name = $item['name'];
$product_id = $item['product_id'];
$product_variation_id = $item['variation_id'];
$pa_version = $item['pa_version'];
}
..... etc...
}
I am still looking for how I should get variation values. if you know let know. this is what I have found.
Thanks,
Related Posts:
- How to add a shortcode button to the TinyMCE editor?
- Is there a plugin that provides a stackoverflow style editor for wordpress? [closed]
- How to check if the product is in a certain category on a single-product.php in Woocommerce?
- Disable plugin / plugin action via theme
- How to enable suggested edits?
- How to change a user’s password programatically
- Plugin upgrading: Widget settings
- Create a table in custom plugin on the activating it?
- How to eliminate weird 404 errors in wp-admin?
- How would you require and automatically download dependent plugins?
- Changing wp login url without .htaccess
- Cannot install plugins even though www-data has write permissions
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- To Disable WordPress Rest API or Not To Disable?
- Simple form that saves to database
- Does wordpress have a post hit counter?
- Email Notifications of new posts to users – suggestions [closed]
- How to call plugin path in JS?
- Create WooCommerce Product Category Programmatically
- Get Current user email as a return string value
- How to call a plugin function from front end form
- Get URL of a specific file
- Building a plugin that doesn’t break when deactivated
- Getting Custom Post Type content from main-site of a Multisite
- translation does not work with text_domain
- Editor not displaying dynamically after clicking on the button
- How can I make content disappear when a user logs in?
- Adding New Role
- $current_user var returns NULL
- Quote rotator in the sidebar
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- Publish Post After Click On A Link
- ‘Lazy loading’ list of posts with pagination
- Get subcategories with JSON API plugin
- Custom url structure for custom template
- WooCommerce plugin appearance and look [closed]
- remove filter which calls a public static function
- ID Conditional User Contact Methods Not Saving
- adding a text message beside the comment submit button
- Replace existing pages with new pages, keep menu links
- How to submit documentation with plugin
- New Plugin: Post update pushes a copy as a revision
- Overide a function that is inside a plugin
- Placement of Code in Plugin for hooking `save_post`
- gallery option is not available in media upload box in costum theme option page
- New post notification plugin [closed]
- If I delete plugins via FTP are settings kept in DB?
- Many plugins making WordPress run slow by design?
- How can plugins have their own pages?
- Exporting and importing my WordPress database, but none of the plugin settings are importing
- Plugin for gallery with thumbnails?
- Adding Plugin-specific Fields with wp_insert_post()?
- How to get the “stats” plugin that comes with a .wordpress.com blog?
- Remove caching from wp_remote_get calls from custom plugin
- API for getting plugin core compatibility?
- Why is the generated POT file from WordPress.org not adding my plugin description to the POT file?
- Transient unique names
- Bouncing scroll
- Reusable functions and tools (Framework)
- Hook into and send mail using WP Mail SMTP type plugin from HTML static front page?
- Override Javascript in a Plugin?
- Preview featured image using frontend post plugin
- Woocommerce – How to populate custom select field with stored values on checkout page?
- How to create ‘import dummy data’ option in custom wordpress plugin
- Missing Argument
- load_plugin_textdomain error
- Globally register styles but enqueue them selectively
- Creating a plugin to sanitize comment and the url field before display only
- Debugs/errors in oqey gallery
- Woocommerce disable shopping cart based on user roles
- Object Oriented Plugin not working
- Adding Shortcode to Text Widget
- W3 Total cache “empty all caches” and no stylesheets render [closed]
- Woocommerce pagination problem
- Does using WP-cron make the site slower for the user?
- Can’t delete Draft Post [closed]
- How to use site_url() in Elementor [closed]
- wp_generate_attachment_metadata is creating an empty array
- How to toggle between two custom fields in WordPress woocommerce ‘WC Product Field Group’ plugin?
- Looking for a way that will collect visitors emails before letting them view the blog posts [closed]
- uninstall.php does not appear to trigger when uninstalling my plugin
- Why “Call to a member function on a non-object” in plugin only?
- Plugin dropping pagination variable
- How to add checkboxes for a woocommerce product? [closed]
- What are the specifics of WordPress development I need to know? [closed]
- Use of Templates in a Plugin
- Insert data from .sql file in wordpress plugin
- Why am I getting ( WooCommerce Services could not be installed (Could not create directory.). ) error and how to solve it ?
- How can i get the post’s full html source by its ID?
- Auto move media file to cloud
- Best place to load wp_ajax_the_ajax_hook action in plugin
- jQuery.post not working within shortcode – WordPress Ajax
- How to echo text in browser instead of download junk file?
- get_post_title is not working on homepage
- Redux Framework: Page freezes on typing in Editor
- How can I inject options into an select tag inside the widget form?
- WordPress user account activation
- Init plugin again after ajax call finish
- Login cookies set as wrong domain
- Use Editorial Calendar on any other page within any other plugin