Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Digict

    (@digict)

    Ok I got it working.

    Putting the code in the templates admin panel didn’t work, but putting it in the actual .php file does. In the end here’s the code I got to work.

    <?php if (! current_user_can('install_plugins') ) { ?>
    
    <!-- ClickDesk Live Chat Service for websites -->
    <script type='text/javascript'>
    etc etc etc
    <!-- End of ClickDesk -->
    
    <?php } ?>
    Thread Starter Digict

    (@digict)

    Thank you.

    I tried using this without success. Am I on the right path?

    if ( ! current_user_can('install_plugins') ) {
    Click desk code
    }
    Thread Starter Digict

    (@digict)

    Thanks that helped me realize where I was going wrong.

    I realized that the woo variables are already being called since this is the “thank you/order review” page.

    So instead of calling the current user email, I just used the order billing email which is already shown on the page.

    So in the end here’s my final code that I inserted into the thankyou.php page:

    <script type="text/javascript">
    var _rrES = {
        seller_id: XXXXXX,
        email: "<?php echo $order->billing_email; ?>",
        invoice: "<?php echo $order->get_order_number(); ?>"},
        auto: true
    };
    (function() {
        var s=document.createElement('script');s.type='text/javascript';s.async=true;
        s.src="https://www.resellerratings.com/popup/include/popup.js";var ss=document.getElementsByTagName('script')[0];
        ss.parentNode.insertBefore(s,ss);
    })();
    </script>
Viewing 3 replies - 1 through 3 (of 3 total)