Hi everyone,
I have a custom module “accounts-type” related to the Quotes module (as are Accounts, Leads, Contacts) and I’m trying to have the address auto-fill, as it does for Accounts.
So I tried to extend controller.php like this but it seems it’s not enough. Am I forgetting something?
Thanks so much for any suggestion.
require_once('modules/AOS_Quotes/controller.php');
class CustomAOS_QuotesController extends AOS_QuotesController
{
public function action_editview()
{
$ac_id = $_REQUEST['ac_ac_anagrafica_aos_quotes_1ac_ac_anagrafica_ida'];
$query = "SELECT * FROM ac_ac_anagrafica WHERE id = '" + $ac_id + "'";
$result = $this->bean->db->query($query, true);
$row = $this->bean->db->fetchByAssoc($result);
$this->bean->ac_ac_anagrafica_aos_quotes_1ac_ac_anagrafica_ida = $row['id'];
$this->bean->ac_ac_anagrafica_aos_quotes_1_name = $row['name'];
$this->bean->billing_address_street = $row['billing_address_street'];
$this->bean->billing_address_city = $row['billing_address_city'];
$this->bean->billing_address_state = $row['billing_address_state'];
$this->bean->billing_address_postalcode = $row['billing_address_postalcode'];
$this->bean->billing_address_country = $row['billing_address_country'];
parent::action_editview();
}
}
It’s allowing me to retrieve the value of my custom module fields within the fields of the Quote module (my custom module is “Account” type so the address fields have the same name).