WooCommerce——修改“Related Products“文字

plugins/woocommerce/templates/single-product/related.php文件:

if ( ! defined( 'ABSPATH' ) ) {
        exit;
}

if ( $related_products ) : ?>

        <section class="related products">
                <hr>hr>
                <h2> esc_html_e( '相关产品', 'woocommerce' ); /*修改这一行*/ ?>h2> 

                 woocommerce_product_loop_start(); ?>

                         foreach ( $related_products as $related_product ) : ?>

                                
                                        $post_object = get_post( $related_product->get_id() );

                                        setup_postdata( $GLOBALS['post'] =& $post_object );

                                        wc_get_template_part( 'content', 'product' ); ?>

                         endforeach; ?>

                 woocommerce_product_loop_end(); ?>

        section>

 endif;

wp_reset_postdata();

你可能感兴趣的:(网站开发)