Menu Close

Add Content Below the “Place Order” Button in WooCommerce checkout page

0
(0)

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>';
    }
} 

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Share

Posted in WooCommerce

Leave a Reply

Your email address will not be published. Required fields are marked *

You can also read...