首页 > 解决方案 > 如何从感谢页面中删除帐单地址?

问题描述

所以我想从感谢页面中删除帐单地址。我正在使用 wordpress,主题为 Impreza。

我的目标是 .woocommerce-customer-details 并设置为 display: none; 它在谷歌检查器模式下工作,但保存并刷新,它仍然显示。我检查了 woo-commerce 模板文件,发现 order-details-customer.php 正在生成信息。我添加了一个类来删除该部分,但它仍然显示出来。

Woocommerce 感谢页面

标签: phpwoocommerce

解决方案


在主题中找到一个名为 woocommerce 的文件夹,如果不存在则创建文件夹:

复制这个文件

/wp-content/plugins/woocommerce/templates/checkout/thankyou.php

并将其粘贴到您的活动主题目录中,如下所示

/wp-content/themes/activetheme/woocommerce/checkout/thankyou.php

并删除这个

<ul class="woocommerce-thankyou-order-details order_details">
    <li class="order">
        <?php _e( 'Order Number:', 'woocommerce' ); ?>
        <strong><?php echo $order->get_order_number(); ?></strong>
    </li>
    <li class="date">
        <?php _e( 'Date:', 'woocommerce' ); ?>
        <strong><?php echo date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ); ?></strong>
    </li>
    <li class="total">
        <?php _e( 'Total:', 'woocommerce' ); ?>
        <strong><?php echo $order->get_formatted_order_total(); ?></strong>
    </li>
    <?php if ( $order->payment_method_title ) : ?>
    <li class="method">
        <?php _e( 'Payment Method:', 'woocommerce' ); ?>
        <strong><?php echo $order->payment_method_title; ?></strong>
    </li>
    <?php endif; ?>
</ul>
<div class="clear"></div>

并删除它

<?php do_action( 'woocommerce_thankyou_' . $order->payment_method, $order->id ); ?>
<?php do_action( 'woocommerce_thankyou', $order->id ); ?>

推荐阅读