Je préférerais pouvoir obtenir le même résultat que sur l'email de confirmation.
Pour la Notification de création de commande, voici mon code. comment faire de même le menu commandes ?
<td>
<table width="100%" style="border: 1px solid #DDDDDD;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;">
<?php
$params = null;
$js = '';
$fieldsClass = hikashop_get('class.field');
$app =& JFactory::getApplication();
if($app->isAdmin()){
$view = 'order';
}else{
$view = 'address';
}
$template = trim(hikashop_getLayout($view,'address_template',$params,$js));
if(!empty($data->cart->billing_address)){
$billing = $template;
foreach($data->order_addresses_fields as $field){
$fieldname = $field->field_namekey;
$address =& $data->order_addresses[$data->cart->billing_address->address_id];
$billing=str_replace('{'.$fieldname.'}',$fieldsClass->show($field,$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->has_shipping) && !empty($data->cart->shipping_address)){
$shipping = $template;
foreach($data->order_addresses_fields as $field){
$fieldname = $field->field_namekey;
$address =& $data->order_addresses[$data->cart->shipping_address->address_id];
$shipping=str_replace('{'.$fieldname.'}',$fieldsClass->show($field,$address->$fieldname),$shipping);
}
echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">'.JText::_('HIKASHOP_SHIPPING_METHOD').'</td></tr><tr><td>';
$shippingClass = hikashop_get('class.shipping');
$shipping = $shippingClass->get($data->order_shipping_id);
$shipping->shipping_params = unserialize($shipping->shipping_params);?>
<?php echo $shipping->shipping_name;?>. </br><?php
echo $shipping->shipping_description;?></br><?php
}
echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">'.JText::_('HIKASHOP_PAYMENT_METHOD').'</td></tr><tr><td>';
if($data->order_payment_method=="banktransfer"){
echo JText::_('ORDER_VALID_AFTER_PAYMENT');
$paymentClass = hikashop_get('class.payment');
$payment = $paymentClass->get($data->order_payment_id);
$payment->payment_params = unserialize($payment->payment_params);
echo $payment->payment_params->information;
}else{
$paymentClass = hikashop_get('class.payment');
$payment = $paymentClass->get($data->order_payment_id);
$payment->payment_params = unserialize($payment->payment_params); ?>
<?php echo $payment->payment_name;?>. </br><?php
echo $payment->payment_description;?></br><?php
}
?>
</table>
</td>