在总计后的 Woocommerce 结帐页面中移动一行

Move a row in Woocommerce checkout page after the total

我需要交换我的结帐-审核-订单-table(税费和总价)中的两行 - 我希望税费显示在总价上方,然后我需要在下方显示信息文本总价和附加行。

如果有可能解决functions.php

中的问题就好了

screenshot checkout

如果您需要任何其他信息,请告诉我。

感谢任何帮助。

在 Woocommerce 结帐页面中,您需要覆盖模板 checkout/review-order.php via the theme

您将不得不移动税区

    <?php if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) : ?>
        <?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) : ?>
            <?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?>
                <tr class="tax-rate tax-rate-<?php echo sanitize_title( $code ); ?>">
                    <th><?php echo esc_html( $tax->label ); ?></th>
                    <td><?php echo wp_kses_post( $tax->formatted_amount ); ?></td>
                </tr>
            <?php endforeach; ?>
        <?php else : ?>
            <tr class="tax-total">
                <th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
                <td><?php wc_cart_totals_taxes_total_html(); ?></td>
            </tr>
        <?php endif; ?>
    <?php endif; ?>

总块

    <?php do_action( 'woocommerce_review_order_before_order_total' ); ?>

    <tr class="order-total">
        <th><?php _e( 'Total', 'woocommerce' ); ?></th>
        <td><?php wc_cart_totals_order_total_html(); ?></td>
    </tr>

    <?php do_action( 'woocommerce_review_order_after_order_total' ); ?>

<!-- #### ====> IN HERE <==== #### -->

它会很好用。不可能以其他方式做到这一点。


文档:Template structure & Overriding templates via a theme