Background of the issue:
I have a custom script which triggers with the hook woocommerce_order_status_processing in theme function file, when the order status is changed to processing. I noticed that order meta data is not saved to the database. A deeper investigation showed that the meta is stored but something deletes it, as add_post_meta returns the meta ID and if I look into the database, there is no such ID. I added die() right after add meta, then everything is okay. Even if I read the meta by ID with get_metadata_by_mid(), it returns the meta. But some other process interrupts and deletes my meta. Then I deactivated plugin by plugin and tested them. After disabling 'WPML Multilingual CMS', the meta is stored and stays in the DB. Site credentials are added into ticket #15899109.
Also i made little script which changes the order status so i can fast check when it works and when not.
I tried with order 415612
Symptoms:
Order meta data is not saved to the database when the order status is changed to processing. The meta data is deleted by some process, which is identified to be related to the 'WPML Multilingual CMS' plugin.
Questions:
Why does the 'WPML Multilingual CMS' plugin delete the order meta data?
How can I prevent 'WPML Multilingual CMS' from deleting the order meta data?
I can't see the issue while trying to replicate this for another order ID as shown in this screen recording hidden link . Is this the correct step to replicate it?
the tag.php is just simulates the order status changes, nothing more.
I did now manually. see my video hidden link
1. checked is meta available - no
2. changed order to pending (ootab maksmist)
3. checked meta - no
4. changed order to processing (Töötluses) - now the hook should add meta to order, but no
5. turned off plugin "WPML Multilingual CMS"
6. changed order status to pending
7. checked meta -no (everything ok, so far there should not be them)
8. changed order to processing, now the hook should trigger and add meta, and it did
in debug.log is visible that system added two meta entries on both points 4 and 8, but somehow the meta created on point 4 disappear
I noticed that the screen recording video wasn't functioning when I checked. However, I'd like to escalate this to our second-tier support. Could you replicate the issue on our sandbox site ? This would help demonstrate whether the issue is specific to your website or can be replicated elsewhere.
I can see the issue in the screen recording. Please try to replicate the issue on our sandbox site so that I can escalate this to our 2nd Tier Support for further investigation.
cannot replicate there seems it works there fine, maybe wpml setting or some other plugin.
but on my site this is strange if I disable WPML, then it works.
I believe a third-party plugin might be causing a conflict. Could you please deactivate all third-party plugins on your website and only activate the WC and WPML plugins? Afterward, please check to see if the issue is resolved.
The topic ‘[Closed] WPML and order processing hook’ is closed to new replies.