duanchi19820419 2015-01-16 15:58
浏览 26

无法改变Woocommerce“谢谢”的消息

I've tried to edit the thankyou.php file in woocommerce to include some new text, but it keeps on showing the default message. I am not familiar with what anything means in php, but this is what I've been trying:

<?php
/**
* Thankyou page
*
* @author       WooThemes
* @package  WooCommerce/Templates
* @version     2.2.0
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

if ( $order ) : ?>

<?php if ( $order->has_status( 'failed' ) ) : ?>

    <p><?php _e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction.', 'woocommerce' ); ?></p>

    <p><?php
        if ( is_user_logged_in() )
            _e( 'Please attempt your purchase again or go to your account page.', 'woocommerce' );
        else
            _e( 'Please attempt your purchase again.', 'woocommerce' );
    ?></p>

    <p>
        <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', 'woocommerce' ) ?></a>
        <?php if ( is_user_logged_in() ) : ?>
        <a href="<?php echo esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>" class="button pay"><?php _e( 'My Account', 'woocommerce' ); ?></a>
        <?php endif; ?>
    </p>

<?php else : ?>

    <p><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Your shirt order has been received and will be at your doorstep in approximately 4 weeks. Thanks again for your support (and general badassery)!', 'woocommerce' ), $order ); ?></p>

    <ul class="order_details">
        <li class="order">
            <?php _e( 'Order:', '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 endif; ?>

<?php do_action( 'woocommerce_thankyou_' . $order->payment_method, $order->id ); ?>
<?php do_action( 'woocommerce_thankyou', $order->id ); ?>
<p><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Your shirt order has been received and will be at your doorstep in approximately 4 weeks. Thanks again for your support (and general badassery)!', 'woocommerce' ), null ); ?></p>
  • 写回答

2条回答 默认 最新

  • doupaoyan6083 2015-01-17 21:02
    关注

    Perhaps your theme is overriding your thank you template file. As a general rule you should never edit the plugin directly. Instead move the thankyou.php to your theme. Move this file to wp-content/themes/yourtheme/woocommerce/checkout/thankyou.php. More information it the documentation here.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题