Checkout payment hook in WooCommerce

Viewed 473

I want to add a markup, <h3>payment</h3>, above the payment methods section in the checkout page.

I tried inserting in files woocommerce/checkout/payment.php, woocommerce/checkout/payment-method.php and woocommerce/checkout/checkout.php.

Regardless where I insert the markup, it will replicate.

Enter image description here

Where should I add the markup?

1 Answers

This is the hook for that area. Place it in your functions.php file:

function woocommerce_before_payment_area( ) { 
    echo '<h3>payment</h3>';
};
add_action( 'woocommerce_review_order_before_payment', 'woocommerce_before_payment_area', 50, 0 );

If it is still doubling up then the hook might already be in your theme. Search your code base for woocommerce_review_order_before_payment and change it there.

Related