Menu Close

Add Content Below the Place Order Button in WooCommerce checkout page

Codeamend

Let’s see  how to Add Content Below the “Place Order” Button in WooCommerce checkout page.

It is very simple and useful to add privacy policy or any short notification.

Here I will give two examples,

  1. Basic
  2. Based on payment gateway

Basic

add_action( 'woocommerce_review_order_after_submit', 'codeamend_message_below_checkout_button' );
 
function codeamend_message_below_checkout_button() {
    echo '<div><h4>What is Lorem Ipsum?</h4><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</p></div>';
} 
Based on payment gateway
function codeamend_message_below_checkout_button() {
    global $woocommerce;
    //Get selected payment method
    $selected_payment_method_id = WC()->session->get( 'chosen_payment_method' );

    if($selected_payment_method_id=="twocheckoutpp"){
       echo '<div><h4>What is Lorem Ipsum?</h4><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</p></div>';
    } else if($selected_payment_method_id=="eh_stripe_pay"){
       echo '<div><h4>Why do we use it?</h4><p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here, making it look like readable English.</p></div>';
    }
} 
Posted in WooCommerce

You can also read...