/**
  * Specify the options to load
  *
  * @copyright
  * @author 		RolandD
  * @todo		Set to use chosen language
  * @see
  * @access 		protected
  * @param
  * @return 		array	an array of options
  * @since 		4.0
  */
 protected function getOptions()
 {
     $this->options = array();
     if (class_exists('com_virtuemart')) {
         $conf = JFactory::getConfig();
         $lang = strtolower(str_replace('-', '_', $conf->get('language')));
         $helper = new Com_VirtueMart();
         $this->options = $helper->getCategoryTree($lang);
     }
     return $this->options;
 }
 /**
  * Specify the options to load
  *
  * @copyright
  * @author 		RolandD
  * @todo		Set to use chosen language
  * @see
  * @access 		protected
  * @param
  * @return 		array	an array of options
  * @since 		4.0
  */
 protected function getOptions()
 {
     $this->options = array();
     if (class_exists('com_virtuemart')) {
         $jinput = JFactory::getApplication()->input;
         $template = $jinput->get('template', null, null);
         $conf = JFactory::getConfig();
         $lang = strtolower($template->get('language', 'general', str_replace('-', '_', $conf->get('language'))));
         $helper = new Com_VirtueMart();
         $this->options = $helper->getCategoryTree($lang);
     }
     return $this->options;
 }
 /**
  * Load the category tree
  *
  * @copyright
  * @author		RolandD
  * @todo
  * @see
  * @access 		public
  * @param
  * @return 		string json encoded values
  * @since 		4.0
  */
 public function loadCategoryTree()
 {
     $jinput = JFactory::getApplication()->input;
     $helper = new Com_VirtueMart();
     $options = $helper->getCategoryTree($jinput->get('language'));
     echo json_encode($options);
 }