Woocommerce中的更改结帐订单复审部分 [英] Change checkout order review section in Woocommerce

查看:179
本文介绍了Woocommerce中的更改结帐订单复审部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Woocommerce中,我已经成功移动了付款方式部分,然后他查看了订单表:


In Woocommerce, I have successfully moved the payment methods section before he review order table: Change payment methods location before order details table in Woocommerce.

I would like to add an <h3> headline ("Your order") and a <p> paragraph ("I have accepte the terms…") in checkout page, just above the review order table.

解决方案

You will replace in your existing code the following block:

add_action( 'woocommerce_checkout_order_review', 'reordering_checkout_order_review', 1 );
function reordering_checkout_order_review(){
    remove_action('woocommerce_checkout_order_review','woocommerce_checkout_payment', 20 );
    add_action( 'woocommerce_checkout_order_review', 'custom_checkout_payment', 8 );
    add_action( 'woocommerce_checkout_order_review', 'custom_checkout_place_order', 20 );
}

By this code block (keeping the 2 other functions):

add_action( 'woocommerce_checkout_order_review', 'reordering_checkout_order_review', 1 );
function reordering_checkout_order_review(){
    remove_action('woocommerce_checkout_order_review','woocommerce_checkout_payment', 20 );

    add_action( 'woocommerce_checkout_order_review', 'custom_checkout_payment', 8 );
    add_action( 'woocommerce_checkout_order_review', 'after_custom_checkout_payment', 9 );
    add_action( 'woocommerce_checkout_order_review', 'custom_checkout_place_order', 20 );
}

function after_custom_checkout_payment() {
    ?>
    <div id="before-order-table" class="woocommerce-checkout-custom-text">
        <h3><?php _e("Your order", "woocommerce"); ?></h3>
        <p><?php _e("I have accepted the terms and bla bla bla", "woocommerce"); ?></p>
    </div>
    <?php
}

Code goes in function.php file of your active child theme (or active theme). Tested and works.

这篇关于Woocommerce中的更改结帐订单复审部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆