1
注文後にWooCommerceのおはようページに達したときにファイルに書きたいと思います。私はfunctions.phpに次のように書いています:WooCommerceをwoocommerce_thankyouにフック
add_action('woocommerce_thankyou', 'test_1', 10, 1);
function test_1(){
//write to a file when this function is run
$contents = date('m/d/Y h:i:s a', time());
file_put_contents('test.txt', $contents);
}
それはなぜ起きていないのですか?
私はこの機能を自分自身でテストしていますが、それ自体は何もしません。したがって、** 'woocommerce_thankyou' **は何もしません。 – LoicTheAztec
woocommerce_thankyou _ {$ order-> payment_method}でお支払い方法を交換してみてください。 – user3040610