Esempio n. 1
0
$orderItems = $model->orderItem;
foreach ($orderItems as $orderItem) {
    $orderItemArray .= DetailView::widget(['model' => $orderItem, 'attributes' => ['name', 'price', 'qty', 'picture:image']]);
}
$orderInfo = DetailView::widget(['model' => $model, 'attributes' => ['total_price', 'shipping_fee', 'payment_fee', 'address', 'memo', 'create_at:datetime', 'update_at:datetime']]);
$orderInfo2 = $this->render('_status', ['model' => $model]);
if ($model->payment) {
    $paymentInfo = DetailView::widget(['model' => $model->payment, 'attributes' => ['payment_method', 'payment_fee', 'transcation_no', 'create_at:datetime']]);
} else {
    $paymentInfo = Yii::t('order', 'Not Paid');
}
if ($model->payment) {
    if ($model->shipment) {
        if ($model->shipment->status != 1) {
            $shipmentInfo = $this->render('_shipment', ['model' => $model->shipment]);
        } else {
            $shipmentInfo = DetailView::widget(['model' => $model->shipment, 'attributes' => ['shipment_method', 'trace_no', 'create_at:datetime']]);
        }
    } else {
        $shipment = Yii::createObject(\star\shipment\models\Shipment::className());
        $shipmentInfo = $this->render('_shipment', ['model' => $shipment, 'orderModel' => $model]);
    }
} else {
    $shipmentInfo = Yii::t('order', 'Not Paid');
}
$items = [['label' => Yii::t('order', 'Order'), 'content' => $orderItemArray . $orderInfo . $orderInfo2], ['label' => Yii::t('app', 'Payment'), 'content' => $paymentInfo], ['label' => Yii::t('order', 'Shipment'), 'content' => $shipmentInfo]];
echo Tabs::widget(['items' => $items]);
?>

</div>
Esempio n. 2
0
 public function getShipment()
 {
     return $this->hasOne(Shipment::className(), ['order_id' => 'order_id']);
 }