<?php
/**
 * @package Tawk.to Integration
 * @author Tawk.to
 * @copyright (C) 2014- Tawk.to
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
?><!--Start of Tawk.to Script-->
<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
<?php
if ($this->customer->isLogged()) {
    ?>
    Tawk_API.visitor = {
        name  : "<?php echo $this->customer->getFirstName(), ' ' ,$this->customer->getLastName(); ?>",
        email : "<?php echo $this->customer->getEmail(); ?>"
    };
    <?php
}
?>
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/<?php echo $page_id ?>/<?php echo $widget_id ?>';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>
<!--End of Tawk.to Script-->
