1
주문 후 WooCommerce 고맙습니다 페이지에 도달하면 파일에 쓰고 싶습니다. 나는 다음을 functions.php에 넣었습니다 :WooCommerce hook into 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