Home > Mobile >  Woocommerce checkout payment hook
Woocommerce checkout payment hook

Time:10-31

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

I tried inserting in 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?

CodePudding user response:

This is the hook for that area, place in your functions.php:

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