Rep_Name (hidden field that makes rep name populate in Form e-mails) PHP Code: //<code>
try{
$db = Joomla\CMS\Factory::getDbo();
$input = Joomla\CMS\Factory::getApplication()->input;
$id = $input->get('form',array('rep_id' => 0), 'array')['rep_id'];
if(!empty($id)){
$query = $db->getQuery(true)->select(array('`a`.`name`'))->from($db->quoteName('#__fast_rep', 'a'))->where($db->quoteName('a.crm_id') . " = " . $id);
$db->setQuery($query);
$result = $db->loadResult();
if(!empty($result)) return $result;
}
}catch(Throwable $t){}
//<code>

 

Rep_Namer (hidden field that makes the rep name populate on the order form link) PHP Code: 

//<code>
$db = Joomla\CMS\Factory::getDbo();
$input = Joomla\CMS\Factory::getApplication()->input;
$id = $input->get('form',array('rep_id' => 0), 'array')['rep_id'];

if(!empty($id)){
$query = $db->getQuery(true)
->select(array('`a`.`name`'))
->from($db->quoteName('#__fast_rep', 'a'))
->where($db->quoteName('a.crm_id') . " = " . $id);

$db->setQuery($query);
$result = $db->loadResult();
if(!empty($result)) return "<h3>Your Rep: " . $result . "</h3>";
}
//<code>

 

 

Package Fields (Replace DIRECTV with the correct provider name as it appears in 'PACKAGES' in front end.) 

//<code>
$db = Joomla\CMS\Factory::getDbo();

$query = $db->getQuery(true)
->select("concat(name,' (',value,') $',cost) as value")
->from($db->quoteName('#__fast_package'))
->where($db->quoteName('type') . " = 'DIRECTV'");
$db->setQuery($query);
$results = $db->loadObjectList();

$ret = array();

foreach($results as $result){
array_push($ret,$result->value);
}
return implode("\n",$ret);
//<code>