Search code examples
phpwordpresswoocommercepaypal

How add custom text after PayPal express checkout button on product page woocommerce


when I add custom text/html to product page I use this code on function.php

add_action('woocommerce_before_add_to_cart_button', 'after_cart_function');
function after_cart_function() {
    echo "my text";
}

the problem is the text show before paypal express checkout button, I like to add after paypal button

I have already try the others hook without success


Solution

  • If you want it after the PayPal button, you need to use this code:

    add_action('woocommerce_after_add_to_cart_button', 'after_cart_function', 1000);
    function after_cart_function() {
        echo "my text";
    }
    

    Edit: You can use the plugin "Simply Show Hooks" to check where to hook.