Foreach loop posting content twice
$10-30 USD
Plačilo ob prevzemu
My plugin pulls values from custom meta data on an order and posts it to discord. I made a change to the script and now it's double posting the custom meta data.
The full file of the script is uploaded as well as an example file that contains just the loop. The loop can be found in the full file as well.
On line 22 I changed
add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'send_order' ), 15 );
To
add_action( 'woocommerce_order_status_processing', array( $this, 'send_order' ), 15 );
Once I change to the status woocommerce_order_status_processing my forloop starts double posting everything. I need the double posting to stop.
Example of how the discord post looks
Bob Joe <-- clients name
Order #123123 <-- order number
Brand New Tee Shirt <-- Product Name
Color: Red <-- What should post
Size: Medium
Color: Red <-- Double post
Size Medium
Only custom options double up and only with that one filter set. I need that filter set though or at least one that triggers when a post is set to processing.
Solution should only trigger when set to processing.
ID projekta: #18357567
Več o projektu
Dodeljeno:
I am here to help you with the foreach loop. Send me a message to discuss it. I am ready to start work right now
4 freelancerjev ponuja v povprečju za $31 na tem delu
Hi, I am ready to fix your loop issue and assure 100% satisfaction guarantee. Please have a look on my profile to see my past work and reviews. Looking forward to your kind response. Regards Muhammad Alyas
Hello there, I am expert in PHP/wordpress. I can resolve that issue right now. so please share live details then let's fix asap. Thanks
Hi i can fix foreach loop issue, i will fix this within 10 minutes, send message for start work right now. thank you.