如何向WooCommerce感谢页面添加自定义JS代码,该页面需要客户信息[重复]

问题描述 投票:0回答:1

如何将这个第三方脚本添加到需要填写一些客户数据的Woocommerce谢谢页面:

<script type="text/javascript">
lr(function(){
    var customerEmail = '{customer_email}';
    if (customerEmail.includes("@")) {
        REFERSION.box.show({
            loc : 'https://www.refersion.com/channels/post_purchase/v2',
            code : '2bf89afa29',
            customer_first_name : encodeURIComponent('{customer_first_name}'),
            customer_last_name : encodeURIComponent('{customer_last_name}'),
            customer_email : encodeURIComponent('{customer_email}')
        });
    }
});
function lr(e){var t=document.createElement("script");t.type="text/javascript";if(t.readyState){t.onreadystatechange=function(){if(t.readyState=="loaded"||t.readyState=="complete"){t.onreadystatechange=null;e()}}}else{t.onload=function(){e()}}t.src="https://www.refersion.com/channels/post_purchase/v2/js";document.body.appendChild(t)}
</script>
javascript wordpress woocommerce hook-woocommerce orders
1个回答
1
投票
© www.soinside.com 2019 - 2024. All rights reserved.