Thanks for the prompt response, Nicolas. Much appreciated.
However, changing the code that you refer to doesn't help with changing the default shipping and billing addresses.
The default shipping and billing addresses are already set in the __construct function in the file components/com_hikashop/controllers/checkout.php. As a test, I have added the following code into the __construct function.
function __construct($config = array(),$skip=false) {
dumpMessage('in __contstruct in controllers/checkout.php');
$app = JFactory::getApplication();
$temp1 = $app->getUserState( HIKASHOP_COMPONENT.'.shipping_address',0 );
$temp2 = $app->getUserState( HIKASHOP_COMPONENT.'.billing_address',0 );
dump($temp1, '$temp1 in __construct');
dump($temp2, '$temp2 in __construct');
The results are as attached.
As per the results, the default values are already set in the __construct function (presumably when the user logs in).
Please let me know where these values are set; I think they are set even before the before_address function that you refer to in your code below.
Thanks.
Take care!