woocommerce修改使用的模板

add_filter('wc_get_template_part','change_checkout_order_received_template',10,3);
function change_checkout_order_received_template($template, $slug, $name){
    if($slug == 'checkout/layouts/checkout' and is_wc_endpoint_url( 'order-received' )){
        $template = '/www/wwwroot/www.xxx.com/wp-content/themes/xxx/woocommerce/checkout/layouts/checkout.php';
    }
    return $template;
}
© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享