<?php
$params = null;
$js = '';
$fieldsClass = hikashop_get('class.field');
$app=JFactory::getApplication();
$template = trim(hikashop_getLayout($app->isAdmin() ? 'order' : 'address','address_template',$params,$js));
if(!empty($data->cart->billing_address)){
$billing = $template;
foreach($data->cart->fields as $field){
$fieldname = $field->field_namekey;
$billing=str_replace('{'.$fieldname.'}',$fieldsClass->show($field,$data->cart->billing_address->$fieldname),$billing);
}
echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">'.JText::_('HIKASHOP_BILLING_ADDRESS').'</td></tr><tr><td>';
echo str_replace(array("\r\n","\r","\n"),'<br/>',preg_replace('#{(?:(?!}).)*}#i','',$billing)).'<br/></td></tr>';
}
if(!empty($data->cart->order_shipping_id) && (!empty($data->cart->shipping_address) || !empty($data->cart->override_shipping_address))){
echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">'.JText::_('HIKASHOP_SHIPPING_ADDRESS').'</td></tr><tr><td>';
if(!empty($data->cart->override_shipping_address)) {
echo $data->cart->override_shipping_address.'<br/></td></tr>';
} else {
$shipping = $template;
foreach($data->cart->fields as $field){
$fieldname = $field->field_namekey;
$shipping=str_replace('{'.$fieldname.'}',$fieldsClass->show($field,$data->cart->shipping_address->$fieldname),$shipping);
}
echo str_replace(array("\r\n","\r","\n"),'<br/>',preg_replace('#{(?:(?!}).)*}#i','',$shipping)).'<br/></td></tr>';
}
}?>
It works.
Maybe the regex content...