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:
- Remove action from plugin on other plugin
- WordPress Plugin Development In MVC Architecture, How?
- How to build an API as a plugin
- What happens when two plugins have the same 3rd party class included into them?
- Update Multiple Post Meta for the Same Post In One call?
- Allowing Custom Capability to Manage Plugin Options
- Create custom column in post table in wordpress
- Add .html extension to custom post type taxonomies
- How to load a new template page according to a particular URL?
- Styles and Scripts, Selectively enqueue across entire site
- Exclude custom post_type in sitemap generation?
- The plugin generated x characters of unexpected output, $wpdb not defined
- Override the core function locate_template
- Admin page: form with enctype=”multipart/form-data” does not transfer its data
- Use oEmbed in List Items
- Trigger renewal order emails for WooCommerce subscriptions for testing
- How Can I Pass the Shortcode’s $atts Variable to the Plugin’s Javascript Function
- Set user ID at time of wp_create_user
- Reset WordPress website
- WordPress Ajax Callback
- Portfolio + Blog: multisite or plugin?
- Building a store locator with google maps
- Runng Cron Job for Plugin With No CronTab Access
- Creating a social media score plugin
- add_menu_page does not seem to work in a class
- Form isn’t inserting data into database with ajax plugin
- WordPress CodeHighlighter
- How would I go about creating a user ranked post popularity page?
- All of my custom posttypes are 404’ing
- WordPress: PHP code rendering in the wrong place
- New to wordpress, Question about editing PHP
- ‘No Results Found’ on single post for custom post type
- Exporting post content from wordpress using WP All Export and wpautop() php function to include paragraph tags
- How to remove the inline styles from the content of a WYSIWYG editor field at the time of saving the post?
- How can I change the plugin update server for specific plugins?
- How to create an input field, and base the output on spreadsheet data? [closed]
- Blacklist IP After Using WordPress Plugin Detector?
- posts comments goes to trash
- WordPress plugin subscribe2 not looking the same as before migration
- Admin style for just one plugin in dashboard
- Trouble adding tiny mce to textarea in custom plugin
- Js file is not adding using this code in functions.php
- Customised plugin failed to install and activate
- Trying to create a table/list of my EventBrite course listings [closed]
- Privileges problem with add_submenu_page [closed]
- Why is one phpunit test throwing an error on one class when all other classes are similar without error?
- WP_Http response throws “Cannot use object of type WP_Error as array”
- XML parser plugin
- Modify wp_installed_email / wp_new_blog_notification
- How to get all posts belongs to a user between a certain date
- Using Variable in WordPress Translate Functions
- Plugin getting Cannot modify header information errors
- Adding inside wp-plugin jQuery script that receives JSON-formatted data, generated by php-function inside this plugin
- iframe not showing in post (with “allow php in posts” plugin activated)
- Add item to the woocommerce dashboard menu from a plugin
- License validate function
- Plugin for an interactive image? [closed]
- Multiple authors and readers restricted by role [closed]
- CSS reset for plugin’s front end?
- Display my plugins content based on a pages post_id
- Make get_permalink() work outside the Loop using filters
- How can I get someone to checkout as soon as they add a product to cart?
- Displaying syntax highlighted code [closed]
- Can you echo PHP code from a variable?
- Pluging with content for a specific page or post
- save data from metabox does not work
- Share buttons Facebook Twitter, just like wordpress.com without webservice
- Restrict posts to customers with complete WooCommerce orders only
- WordPress not showing manually uploaded files in Uploads folder on Media Library
- Upload Image with a file URL and show dynamically on Frontend
- Use get_pages() before another plugin modifies it
- How can I adjust my function so the page editor still loads in the backend?
- How can i solve php upgrade problem
- Submitting form to PHP
- How use get_plugin_updates() function?
- how override a define
- WordPress plugin blog creation
- Preserving existing functionality converting HTML to WordPress
- Modifying server’s response to API endpoint
- FTP access to NAS drive files/folders from WordPress site
- Change Jobs for WordPress templates
- Issue calling my functions on Plugin activate in WordPress
- WPGlobus Multilingual – REST API
- Restoring a WordPress site
- Custom SportsPress list
- Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?
- Add predefined values to custom post plugin
- Display Powerpress media url
- How to copy data from user profile page (profile.php) to theme customizer
- Custom shortcode with dynamic rewrite
- wp-admin will not redirect to wp-login.php
- Problem with wp_editor
- multiple external urls in wordpress website
- Can’t upgrade themes or plugins after upgrading WordPress to 4.4
- How to add a filter conditionally based on page related Conditional Tags
- User register hook can’t access form request
- Additional scrollbar appears inside the browser on every page + lag scroll -Winner theme
- Publish post facebook page & twitter automatically [closed]
- How I can hide my wp folders from Inspect Element (Developer Tools)
- How to modify submit button on GravityForms