context->getProducerCurrent();
$this->setTitle('Mes commandes') ;
$this->addButton(['label' => ' Ajouter', 'url' => 'order/order', 'class' => 'btn btn-primary']) ;
?>
Votre commande a bien été prise en compte.
Votre commande a bien été annulée.
=
GridView::widget([
'dataProvider' => $dataProviderOrders,
'summary' => '',
'beforeRow' => function($order) use ($orderManager) {
$orderManager->initOrder($order) ;
},
'columns' => [
[
'attribute' => 'distribution.date',
'label' => 'Date de livraison',
'format' => 'raw',
'value' => function($order) use ($orderManager) {
return $orderManager->getDateAsHtml($order) ;
}
],
[
'label' => 'Point de vente',
'format' => 'raw',
'value' => function($order) use ($orderManager) {
return $orderManager->getPointSaleSummary($order);
}
],
[
'label' => 'Résumé',
'format' => 'raw',
'value' => function($order) use ($orderManager) {
return $orderManager->getCartSummary($order);
}
],
[
'label' => 'Montant',
'format' => 'raw',
'value' => function($order) use ($orderManager) {
return $orderManager->getAmountSummary($order);
}
],
[
'label' => 'Statut',
'format' => 'raw',
'value' => function($order) use ($orderManager) {
$html = '' ;
if($order->date_delete) {
$html .= '
Annulée' ;
}
else {
if($orderManager->getState($order) == Order::STATE_DELIVERED) {
$html .= '
Livrée' ;
}
elseif($orderManager->getState($order) == Order::STATE_PREPARATION) {
$html .= '
En préparation' ;
}
elseif($orderManager->getState($order) == Order::STATE_OPEN) {
$html .= '
À venir' ;
}
}
return $html ;
}
],
[
'label' => 'Actions',
'format' => 'raw',
'value' => function($order) use ($producer, $producerManager, $orderManager) {
$html = '' ;
if($orderManager->getState($order) == Order::STATE_OPEN) {
if ($producerManager->isOnlinePaymentActiveAndTypeOrder($producer)) {
$paymentStatus = $orderManager->getPaymentStatus($order);
if($paymentStatus == Order::PAYMENT_UNPAID && $order->online_payment_url) {
$html .= '
Payer en ligne';
}
}
else {
$html .= '
'.
'
'.
(($order->id_subscription) ? '
' : '') ;
}
}
return $html ;
}
]
]
]);
?>