diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index 715c90a2c..6b29aa081 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -159,7 +159,11 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap && strpos($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/block-preview') === false) { if (Application_Model_Preference::GetLiveChatEnabled()) { $client_id = Application_Model_Preference::GetClientId(); - $view->headScript()->appendScript("var livechat_client_id = '$client_id';"); + $plan_level = Application_Model_Preference::GetPlanLevel(); + $station_url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; + $view->headScript()->appendScript("var livechat_client_id = $client_id;\n". + "var livechat_plan_type = '$plan_level';\n". + "var livechat_station_url = 'http://$station_url';"); $view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); } } diff --git a/airtime_mvc/public/js/airtime/common/livechat.js b/airtime_mvc/public/js/airtime/common/livechat.js index 35801c697..0adc99d83 100644 --- a/airtime_mvc/public/js/airtime/common/livechat.js +++ b/airtime_mvc/public/js/airtime/common/livechat.js @@ -5,7 +5,9 @@ function setupLiveChat() { // this is where we pass custom variables to livechat; // only pass the client id assigned by WHMCS for now __lc.params = [ - { name: 'client_id', value: livechat_client_id } + { name: 'client_id', value: livechat_client_id }, + { name: 'plan_type', value: livechat_plan_type}, + { name: 'station_url', value: livechat_station_url} ]; var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true; @@ -15,4 +17,4 @@ function setupLiveChat() { $(document).ready(function() { setupLiveChat(); -}); \ No newline at end of file +});