webdevask.com

Menu

  • Home
  • New
  • Add question

php - Checkout payment hook in WooCommerce

View Original

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?

Answer

Solution:

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.

Source

See also:

  • php สร้าง Google ชีตจากบัญชีบริการ

  • php - Laravel 8.0 Installation Failed

  • javascript - How to include HTML data (tags) as value in "arrayToDataTable" of Google Pie Chart?

  • how to Grouping array in php

  • php - vender folder from my laravel project has more 1k error

© 2021
E-mail: contact@webdevask.com
Back to top