menu commandes en front-end

  • Posts: 21
  • Thank you received: 0
13 years 1 month ago #27833

Comment reprendre les données de méthodes d'envoi et de paiement dans la vue order show en front-end ?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 1 month ago #27859

comme cela par exemple:
<?php echo $this->order->order_payment_method; ?>
Par contre, cela affiche juste le nom du plugin...

Sinon c'est un peux plus complexe pour avoir le nom entré dans l'interface:
<?php
$class = hikashop_get('class.payment');
$payment = $class->get($this->order->order_payment_id);
echo $payment->payment_name; ?>

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 0
13 years 1 month ago #27862

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>

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 1 month ago #27873

C'est très simple. Le même code mais avec $this->order à la place de $data

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 0
13 years 1 month ago #27904

merci beaucoup ! maintenant ça fonctionne à merveille !

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum