Looks like I found the issue. It was the fact that ‘woocommerce_payment_complete’ hook
was too early BUT the hook ‘woocommerce_pre_payment_complete‘ is called first after payment is made but before order status change and before the email is sent. 🙂
So all I changed in the add_action was change:
woocommerce_payment_complete’ TO woocommerce_pre_payment_complete that’s it.
And it worked.
part of the add_action updated code
Related Posts:
- WordPress is automatically linking plain text email addresses
- Objective Best Practices for Plugin Development? [closed]
- How do i best handle custom plugin page actions?
- How to create an API for my plugin?
- Plugins in symlinked directories?
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Plugin Form Submission Best Practice
- Best way to abort plugin in case of insufficient PHP version?
- What do you think about custom designed plugin/theme options UIs?
- Where to put third party PHP library?
- How to use PanelColorSettings in custom Gutenberg block?
- Optimize shortcode callbacks
- How to integrate a PHP webmail script into the backend of WordPress?
- Is There A Hook To Process The Content Of The Text Widget?
- Writing a plugin that notify my friends of new post that mentions(@) them
- How to log plugin errors to plugin error_log file
- Which to use to execute code during the saving of a plugin settings page?
- Custom theme sufficient or custom plugin neccessary for this feature set?
- When to check if a function exists
- How to create custom home page via plugin?
- Adding callback function for wp_ajax_ has no effect
- Sessions not creating correctly in custom function
- wp_mail not recognizing cc and bcc headers
- Featured Image not showing in admin
- How Can I setup WP CLI on Windows development machine running AMPPS?
- WP_LOCALIZE_SCRIPT doesn’t work
- Nuance in adding CPT and TAX to a submenu
- Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
- How to edit mySQL wp_posts table from plugin php?
- Get the password key when using the wp_new_user_notification_email filter
- Why my database table not created on activation?
- How to deal with equal & similar arguments for a function?
- Executing a function upon webhook calling wordpress
- Customizer: widget-synced triggers twice
- How to update an existing table while updating plugin?
- Adding functions to hooks from within a class
- Disable The Events Calendar plugin from loading its scripts
- Applying OO patterns and principles to plugin development
- Is Using WordPress Supplied WYSIWYG Advisable?
- Is it possible to change a term slug before being saved to the database?
- Storing product price data in the database
- Maximum lifetime for nonce
- Add code inside specific wordpress standard function
- Custom Taxonomy to dropdown box on adminside wordpress
- Create a free scripts and styles template within a plugin
- How to modify the comments to be displayed in a post?
- How can I turn a custom wordpress page into a product page?
- Incorporate small angular feature in my wordpress site
- How to Bind one post object Type with other postobject Type in Advanced Custom field [closed]
- Search: how to extend the existing search to include a custom table
- Is there documentation reference for forms in menu and setting pages?
- Gutenberg table block with Bootstrap .table class
- Enqueue script globally
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- dbDelta not installing database
- Custom entity search and display
- Plugin: database creation
- Loading Modernizr (or other JavaScript libraries) for use in a plugin
- Show message from backend
- Why in this archive page that call query_posts() function show only the last 10 posts?
- How to add a hyperlink to the email content in WordPress?
- Logout after clicking URL link results in “headers already sent” error
- how to save wp_editor html content in options table
- What is the way to hook all wordpress email
- Converting core modification to a plugin
- How to replace settings in WordPress plugin from a theme
- How to remove/replace current page template?
- Setting a post’s category
- How to determine which capability to use?
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- wp_new_user_notifications to notify user and admin about new user registration
- Using wp_mail to send email?
- Why won’t this submenu page show? – My First WordPress Plugin
- How to check if `comment_meta` exists before inserting the comment?
- How to create a custom post-new.php page for plugin , no wp menu
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Save meta box data from selected dropdown list in bbpress reply form
- Dynamically modify content added to table via javascript
- Email content as comment
- using wordpress acf shortcods in tables goes outside the table
- Create Customization panel for Plugins not for theme
- Determine if the current page, is being edited
- external Integration with wordpress timeout error
- Making adding info to an overlay bio easy for average user?
- Implementing Select2 plugin into WordPress
- WordPress mails being sent from @locahost and being rejected
- Displaying settings information in a table
- Associating special meaning with user id 0
- Managing Custom Designed Content
- Can I access WordPress API’s from within plugin scripts?
- Link to a admin submenu item using a custom link
- Change the search results header from plugin
- Dynamic banner for use on external sites
- Client Profiles
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- How to Implement SAM Broadcaster with WordPress? [closed]
- Can I use an array to create multiple tables?
- Extend WP_List_Table class – Edit wp_usermeta – WPPB.me Boilerplate – Action error
- Developing an IP lookup function using an API