Hello
I have a question concerning CB Autoaction and CB activity
As you advised some months ago we use this code in an anautoaction to save data in CB activity :
Code:
//todo find group for any activation
//default cat to pro 0 group 55 and event to negopack 26 group 26
$v_cat = $user->cb_activ_cats != 0 ? $user->cb_activ_cats : 0;
$v_event = $user->cb_marketevents > 0 ? $user->cb_marketevents : 26;
$v_group = $v_event != 26 ? 56 : 55;
$variables['var3']->params()->set( 'activ', htmlspecialchars($input->getString( 'activ' )) );
$locationId = '1';
$locationPlace = htmlspecialchars($input->getString( 'si_place' ));
$lat = htmlspecialchars($input->getString( 'si_lat' ));
$long = htmlspecialchars($input->getString( 'si_long' ));
$locationAddress = $lat . ',' . $long;
$newLocation = array('id' => $locationId,'place' => ( $locationId ? $locationPlace : '' ),'address' => ( $locationId ? $locationAddress : '' ));
$variables['var3']->params()->set( 'location', $newLocation );
$variables['var3']->params()->set( 'data-company-id', htmlspecialchars($input->getString( 'si_company_id' )) );
$variables['var3']->params()->set( 'category', $v_cat );
$variables['var3']->params()->set( 'event',$v_event);
$variables['var3']->set( 'asset', 'activha.group.' . $v_group . '.event.' . $v_event . '.activation.[var3_user_id]' );
The code works fine but we would like to save the data si_company_id to another table than #_comprofiler_plugin_activity for our needs, say the table #__activations in the field company_number
The issue is that whatever php code we insert in the above auto action in a new line, this code does not save the data.
we tried in a new php line :
Code:
$company_number = 'test';
$enrich_company = 'test';
$values = array($db->quote($company_number),$db->quote($enrich_company) );
$query->insert($db->quoteName('#__activations'));
$query->columns($db->quoteName($columns));
$query->values(implode(',', $values));
$db->setQuery($query);
$db->execute();
or
Code:
$si_company_id = 'test';
$enrich_datas = 'test';
$query = "INSERT INTO #__activations(company_number, enrich_company) VALUES(\"".$db->quote($si_company_id)."\",\"".$db->quote($enrich_datas)."\")";
$db->setQuery( $query);
$db->Query();
But both codes do nothing nor return any error.
Is there a specific way with CB autoaction to save to another table ?