Lorsque je colle le code ci-dessous directement dans le thankyou.php
, cela fonctionne parfaitement bien. mais quand j'essaye de l'accrocher en woocommerce_thankyou
, rien ne se passe.woocommerce_thankyou crochet ne fonctionne pas
Je viens juste de commencer avec PHP,
add_action('woocommerce_thankyou', 'test_1', 10, 1);
function test_1() {
$paymethod = $order->payment_method_title;
$orderstat = $order->get_status();
if (($orderstat == 'completed') && ($paymethod == 'PayPal')) {
echo "something";
} elseif (($orderstat == 'processing') && ($paymethod == 'PayPal')) {
echo "some other shit";
} elseif (($orderstat == 'pending') && ($paymethod == 'PayPal')) {
echo "some other shit";
}
}
Qu'entendez-vous par 'hook'? – Neil
comment vous essayez de l'accrocher? –