Recently, one of my customers wanted to automatically mark an order on WordPress as completed one day after the order.
As you may know, cron-job process in WordPress does not working like cron-jobs in PHP. If you have low amount of visitors, the first visit triggers it. Additionally, some cache plugins may prevent this but our topic is not directly related with this.
In WordPress, you can trigger any function that you want to run by adding “woocommerce_thankyou” action when an order is completed. Well, is this the best solution?
WooCommerce Thank You Page Problem Scenarios
Some payment gateways open a thank you page, place a button on this page and open the payment page as a new page or in pop-up. For example, Redsys. Then, when payment is received, they show a “payment successful” page. On bottom-right part of the page, a small button exists and if your customer doesn’t click on it, your function will not work.
It is the same on Paypal. During payment process with Paypal, if the user closes the page right after he/she completes payment, the page is not displayed.
Cash on Delivery and Money Orders
With cash on delivery and money orders, on the other hand, you can trust woocommerce_thankyou page.
add_action( 'woocommerce_thankyou','wf_recieve_order', 10, 1 );
Payment Gateways With Instant Payments
For Paypal and some credit card payment gateways, we will use payment completed hook. This way, no matter what happens, our function will run if payment is completed.
add_action( 'woocommerce_payment_complete','wf_recieve_order', 10, 2 );
It is really necessary to be careful about delicate matters like payment, otherwise you may encounter serious problems.
What do you think?
If you click you will be surprised!
Just Click And Give Correct Answer To Get Your Free Gift Card
2009 Sep 22; 54 13 1189 dapoxetina generico
online courses with qualifications
This internet site is my inhalation, very superb design and perfect content material.
Dehydration is the primary issue if you re not able to pee after taking Lasix because an increasing frequency of pee is expected after taking it generic priligy
I’ve been surfing on-line more than 3 hours nowadays, but I by no means discovered any fascinating article like yours. It’s lovely price sufficient for me. Personally, if all webmasters and bloggers made excellent content as you did, the web can be much more useful than ever before. “Baseball is 90 percent mental. The other half is physical.” by Lawrence Peter Berra.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
the best in this business thank you,journalsoa
the best in this business thank you,emedicalcentral
the best in this business thank you,journalsoa
the best in this business thank you,clinicalmedicaljournals
the best in this business thank you,medicalres
experience and quality thank you.fourtech
experience and quality thank you.francobenvenutiartista
experience and quality thank you.tendertoo
the best in this business thank you,liusaari
the best in this business thank you,maketeamstudiot
the best in this business thank you,masmoudi
experience and quality thank you.itcimpianti
experience and quality thank you.hotelprincipessalucca
experience and quality thank you.doubleclick
experience and quality thank you.klfgoteborg
experience and quality thank you.edm-nivelles
the best in this business thank you,jayteeinsurance
the best in this business thank you,jeromeandleighcrutch
the best in this business thank you,jerryshulmanproduceshipper
the best in this business thank you,jerryspridepotatoes
the best in this business thank you,jerryshulmanproduce
the best in this business thank you,juventuspizza
the best in this business thank you,jvidesigns
the best in this business thank you,konarprecision
the best in this business thank you,justmyvoice
the best in this business thank you,leoemma
experience and quality thank you.emperorsoft
experience and quality thank you.live-now
experience and quality thank you.saafa
the best in this business thank you,leonfukspc
the best in this business thank you,ligbtour
the best in this business thank you,lioutdoorliving
the best in this business thank you,liontrading
the best in this business thank you,lewisy
the best in this business thank you,lckcabinetry
the best in this business thank you,longislandcocktailhours
the best in this business thank you,lordshoes
the best in this business thank you,louisbarbatolandscaping
the best in this business thank you,luisrestorations
the best in this business thank you,lorlin
experience and quality thank you.huisjacobs
the best in this business thank you,icredit
the best in this business thank you,rands
the best in this business thank you,thewindowmill
the best in this business thank you,touchofclasscoll
the best in this business thank you,unityrubbercompany
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
the best in this business thank you,brcanvas
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.