diff --git a/assets/OrderAsset.php b/assets/OrderAsset.php new file mode 100755 index 0000000..967a501 --- /dev/null +++ b/assets/OrderAsset.php @@ -0,0 +1,28 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => [ 'POST' ], + ], + ], + ]; + } + + /** + * Lists all Delivery models. + * + * @return mixed + */ + public function actionIndex() + { + $searchModel = new DeliverySearch(); + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + return $this->render( + 'index', + [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ] + ); + } + + /** + * Displays a single Delivery model. + * + * @param integer $id + * + * @return mixed + */ + public function actionView($id) + { + return $this->render( + 'view', + [ + 'model' => $this->findModel($id), + ] + ); + } + + /** + * Creates a new Delivery model. + * If creation is successful, the browser will be redirected to the 'view' page. + * + * @return mixed + */ + public function actionCreate() + { + $model = new Delivery(); + $model->generateLangs(); + if ($model->loadWithLangs(Yii::$app->request) && $model->saveWithLangs()) { + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } else { + return $this->render( + 'create', + [ + 'model' => $model, + 'modelLangs' => $model->modelLangs, + ] + ); + } + } + + /** + * Updates an existing Delivery model. + * If update is successful, the browser will be redirected to the 'view' page. + * + * @param integer $id + * + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + $model->generateLangs(); + + if ($model->loadWithLangs(Yii::$app->request) && $model->saveWithLangs()) { + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } else { + return $this->render( + 'update', + [ + 'model' => $model, + 'modelLangs' => $model->modelLangs, + ] + ); + } + } + + /** + * Deletes an existing Delivery model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * + * @param integer $id + * + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id) + ->delete(); + + return $this->redirect([ 'index' ]); + } + + /** + * Finds the Delivery model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * + * @param integer $id + * + * @return Delivery the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (( $model = Delivery::findOne($id) ) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } + } diff --git a/controllers/LabelController.php b/controllers/LabelController.php new file mode 100644 index 0000000..4ccf94b --- /dev/null +++ b/controllers/LabelController.php @@ -0,0 +1,168 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => [ 'POST' ], + ], + ], + ]; + } + + /** + * Lists all Label models. + * + * @return mixed + */ + public function actionIndex() + { + $searchModel = new LabelSearch(); + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + return $this->render( + 'index', + [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ] + ); + } + + /** + * Displays a single Label model. + * + * @param integer $id + * + * @return mixed + */ + public function actionView($id) + { + return $this->render( + 'view', + [ + 'model' => $this->findModel($id), + ] + ); + } + + /** + * Creates a new Label model. + * If creation is successful, the browser will be redirected to the 'view' page. + * + * @return mixed + */ + public function actionCreate() + { + $model = new Label(); + $model->generateLangs(); + if ($model->loadWithLangs(Yii::$app->request) && $model->saveWithLangs()) { + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } else { + return $this->render( + 'create', + [ + 'model' => $model, + 'modelLangs' => $model->modelLangs, + ] + ); + } + } + + /** + * Updates an existing Label model. + * If update is successful, the browser will be redirected to the 'view' page. + * + * @param integer $id + * + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + $model->generateLangs(); + + if ($model->loadWithLangs(Yii::$app->request) && $model->saveWithLangs()) { + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } else { + return $this->render( + 'update', + [ + 'model' => $model, + 'modelLangs' => $model->modelLangs, + ] + ); + } + } + + /** + * Deletes an existing Label model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * + * @param integer $id + * + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id) + ->delete(); + + return $this->redirect([ 'index' ]); + } + + /** + * Finds the Label model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * + * @param integer $id + * + * @return Label the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (( $model = Label::findOne($id) ) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } + } diff --git a/controllers/OrderController.php b/controllers/OrderController.php new file mode 100644 index 0000000..9e81d8b --- /dev/null +++ b/controllers/OrderController.php @@ -0,0 +1,281 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => [ 'POST' ], + ], + ], + ]; + } + + /** + * Lists all Order models. + * + * @return mixed + */ + public function actionIndex() + { + $searchModel = new OrderSearch(); + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + $labels = Label::find() + ->select( + [ + 'title', + 'id', + ] + ) + ->joinWith('lang') + ->andWhere( + [ + 'status' => true, + ] + ) + ->indexBy('id') + ->column(); + + return $this->render( + '@artbox/order/views/order/index', + [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + 'labels' => $labels, + ] + ); + } + + /** + * Displays a single Order model. + * + * @param integer $id + * + * @return mixed + */ + public function actionView($id) + { + return $this->render( + '@artbox/order/views/order/view', + [ + 'model' => $this->findModel($id), + ] + ); + } + + /** + * Creates a new Order model. + * If creation is successful, the browser will be redirected to the 'view' page. + * + * @return mixed + */ + public function actionCreate() + { + $model = new Order(); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } else { + $labels = Label::find() + ->joinWith('lang') + ->select( + [ + 'title', + 'id', + ] + ) + ->where( + [ + 'status' => true, + ] + ) + ->indexBy('id') + ->column(); + $deliveries = Delivery::find() + ->joinWith('lang') + ->select( + [ + 'title', + 'id', + ] + ) + ->where( + [ + 'status' => true, + ] + ) + ->indexBy('id') + ->column(); + $payments = Payment::find() + ->joinWith('lang') + ->select( + [ + 'title', + 'id', + ] + ) + ->where( + [ + 'status' => true, + ] + ) + ->indexBy('id') + ->column(); + return $this->render( + '@artbox/order/views/order/create', + [ + 'model' => $model, + 'labels' => $labels, + 'payments' => $payments, + 'deliveries' => $deliveries, + ] + ); + } + } + + /** + * Updates an existing Order model. + * If update is successful, the browser will be redirected to the 'view' page. + * + * @param integer $id + * + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + if (Model::loadMultiple($model->orderProducts, \Yii::$app->request->post()) && Model::validateMultiple( + $model->orderProducts + ) + ) { + foreach ($model->orderProducts as $orderProduct) { + $orderProduct->save(false); + } + } + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } else { + $labels = Label::find() + ->joinWith('lang') + ->select( + [ + 'title', + 'id', + ] + ) + ->where( + [ + 'status' => true, + ] + ) + ->indexBy('id') + ->column(); + $deliveries = Delivery::find() + ->joinWith('lang') + ->select( + [ + 'title', + 'id', + ] + ) + ->where( + [ + 'status' => true, + ] + ) + ->indexBy('id') + ->column(); + $payments = Payment::find() + ->joinWith('lang') + ->select( + [ + 'title', + 'id', + ] + ) + ->where( + [ + 'status' => true, + ] + ) + ->indexBy('id') + ->column(); + return $this->render( + '@artbox/order/views/order/update', + [ + 'model' => $model, + 'labels' => $labels, + 'payments' => $payments, + 'deliveries' => $deliveries, + ] + ); + } + } + + /** + * Deletes an existing Order model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * + * @param integer $id + * + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id) + ->delete(); + + return $this->redirect([ 'index' ]); + } + + /** + * Finds the Order model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * + * @param integer $id + * + * @return Order the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (( $model = Order::findOne($id) ) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } + } diff --git a/controllers/OrderProductController.php b/controllers/OrderProductController.php new file mode 100644 index 0000000..99654c1 --- /dev/null +++ b/controllers/OrderProductController.php @@ -0,0 +1,157 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => [ 'POST' ], + ], + ], + ]; + } + + /** + * Lists all OrderProduct models. + * + * @return mixed + */ + public function actionIndex() + { + $searchModel = new OrderProductSearch(); + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + return $this->render( + '@artbox/order/views/order-product/index', + [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ] + ); + } + + /** + * Displays a single OrderProduct model. + * + * @param integer $id + * + * @return mixed + */ + public function actionView($id) + { + return $this->render( + '@artbox/order/views/order-product/view', + [ + 'model' => $this->findModel($id), + ] + ); + } + + /** + * Creates a new OrderProduct model. + * If creation is successful, the browser will be redirected to the 'view' page. + * + * @return mixed + */ + public function actionCreate() + { + $model = new OrderProduct(); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } else { + return $this->render( + '@artbox/order/views/order-product/create', + [ + 'model' => $model, + ] + ); + } + } + + /** + * Updates an existing OrderProduct model. + * If update is successful, the browser will be redirected to the 'view' page. + * + * @param integer $id + * + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } else { + return $this->render( + '@artbox/order/views/order-product/update', + [ + 'model' => $model, + ] + ); + } + } + + /** + * Deletes an existing OrderProduct model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * + * @param integer $id + * + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id) + ->delete(); + + return $this->redirect([ 'index' ]); + } + + /** + * Finds the OrderProduct model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * + * @param integer $id + * + * @return OrderProduct the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (( $model = OrderProduct::findOne($id) ) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } + } diff --git a/controllers/PaymentController.php b/controllers/PaymentController.php new file mode 100644 index 0000000..c1123fc --- /dev/null +++ b/controllers/PaymentController.php @@ -0,0 +1,167 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => [ 'POST' ], + ], + ], + ]; + } + + /** + * Lists all Payment models. + * + * @return mixed + */ + public function actionIndex() + { + $searchModel = new PaymentSearch(); + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + return $this->render( + 'index', + [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ] + ); + } + + /** + * Displays a single Payment model. + * + * @param integer $id + * + * @return mixed + */ + public function actionView($id) + { + return $this->render( + 'view', + [ + 'model' => $this->findModel($id), + ] + ); + } + + /** + * Creates a new Payment model. + * If creation is successful, the browser will be redirected to the 'view' page. + * + * @return mixed + */ + public function actionCreate() + { + $model = new Payment(); + $model->generateLangs(); + if ($model->loadWithLangs(Yii::$app->request) && $model->saveWithLangs()) { + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } else { + return $this->render( + 'create', + [ + 'model' => $model, + 'modelLangs' => $model->modelLangs, + ] + ); + } + } + + /** + * Updates an existing Payment model. + * If update is successful, the browser will be redirected to the 'view' page. + * + * @param integer $id + * + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + $model->generateLangs(); + if ($model->loadWithLangs(Yii::$app->request) && $model->saveWithLangs()) { + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } else { + return $this->render( + 'update', + [ + 'model' => $model, + 'modelLangs' => $model->modelLangs, + ] + ); + } + } + + /** + * Deletes an existing Payment model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * + * @param integer $id + * + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id) + ->delete(); + + return $this->redirect([ 'index' ]); + } + + /** + * Finds the Payment model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * + * @param integer $id + * + * @return Payment the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (( $model = Payment::findOne($id) ) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } + } diff --git a/migrations/m170503_145306_create_order_product_table.php b/migrations/m170503_145306_create_order_product_table.php index 50c1cb3..09cdda2 100755 --- a/migrations/m170503_145306_create_order_product_table.php +++ b/migrations/m170503_145306_create_order_product_table.php @@ -15,10 +15,10 @@ $this->createTable( 'order_product', [ - 'id' => $this->primaryKey(), 'order_id' => $this->integer() ->notNull(), - 'variant_id' => $this->integer(), + 'variant_id' => $this->integer() + ->notNull(), 'sku' => $this->string() ->notNull(), 'price' => $this->decimal(), @@ -45,6 +45,15 @@ 'SET NULL', 'CASCADE' ); + + $this->addPrimaryKey( + 'order_product_pkey', + 'order_product', + [ + 'order_id', + 'variant_id', + ] + ); } /** diff --git a/models/Delivery.php b/models/Delivery.php index 0d7c8ab..7c0e67e 100644 --- a/models/Delivery.php +++ b/models/Delivery.php @@ -55,6 +55,18 @@ /** * @inheritdoc */ + public function behaviors() + { + return [ + 'language' => [ + 'class' => LanguageBehavior::className(), + ], + ]; + } + + /** + * @inheritdoc + */ public function rules() { return [ @@ -76,18 +88,6 @@ /** * @inheritdoc */ - public function behaviors() - { - return [ - 'language' => [ - 'class' => LanguageBehavior::className(), - ], - ]; - } - - /** - * @inheritdoc - */ public function attributeLabels() { return [ diff --git a/models/DeliverySearch.php b/models/DeliverySearch.php new file mode 100644 index 0000000..83951f1 --- /dev/null +++ b/models/DeliverySearch.php @@ -0,0 +1,120 @@ +joinWith('lang'); + + // add conditions that should always apply here + + $dataProvider = new ActiveDataProvider( + [ + 'query' => $query, + 'sort' => [ + 'attributes' => [ + 'title' => [ + 'asc' => [ 'delivery_lang.title' => SORT_ASC ], + 'desc' => [ 'delivery_lang.title' => SORT_DESC ], + ], + 'id', + 'value', + 'status', + ], + ], + ] + ); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + // grid filtering conditions + $query->andFilterWhere( + [ + 'id' => $this->id, + 'sort' => $this->sort, + 'value' => $this->value, + 'status' => $this->status, + ] + ); + $query->andFilterWhere( + [ + 'like', + 'delivery_lang.title', + $this->title, + ] + ); + + return $dataProvider; + } + } diff --git a/models/Label.php b/models/Label.php index 711eef4..9c25f2f 100644 --- a/models/Label.php +++ b/models/Label.php @@ -1,10 +1,14 @@ [ + 'class' => LanguageBehavior::className(), + ], + ]; + } + /** * @inheritdoc */ @@ -46,7 +85,7 @@ ], ]; } - + /** * @inheritdoc */ @@ -59,7 +98,7 @@ 'status' => Yii::t('order', 'Status'), ]; } - + /** * @return \yii\db\ActiveQuery */ @@ -67,16 +106,16 @@ { return $this->hasMany(LabelLang::className(), [ 'label_id' => 'id' ]); } - + /** * @return \yii\db\ActiveQuery */ public function getLanguages() { return $this->hasMany(Language::className(), [ 'id' => 'language_id' ]) - ->viaTable('label_lang', [ 'label_id' => 'id' ]); + ->viaTable('label_lang', [ 'label_id' => 'id' ]); } - + /** * @return \yii\db\ActiveQuery */ diff --git a/models/LabelSearch.php b/models/LabelSearch.php new file mode 100644 index 0000000..de3b2fa --- /dev/null +++ b/models/LabelSearch.php @@ -0,0 +1,120 @@ +joinWith('lang'); + + // add conditions that should always apply here + + $dataProvider = new ActiveDataProvider( + [ + 'query' => $query, + 'sort' => [ + 'attributes' => [ + 'title' => [ + 'asc' => [ 'label_lang.title' => SORT_ASC ], + 'desc' => [ 'label_lang.title' => SORT_DESC ], + ], + 'id', + 'value', + 'status', + ], + ], + ] + ); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + // grid filtering conditions + $query->andFilterWhere( + [ + 'id' => $this->id, + 'sort' => $this->sort, + 'value' => $this->value, + 'status' => $this->status, + ] + ); + $query->andFilterWhere( + [ + 'like', + 'label_lang.title', + $this->title, + ] + ); + + return $dataProvider; + } + } diff --git a/models/Order.php b/models/Order.php index 30bf5f1..c6daa28 100644 --- a/models/Order.php +++ b/models/Order.php @@ -3,6 +3,7 @@ namespace artbox\order\models; use Yii; + use yii\behaviors\TimestampBehavior; use yii\db\ActiveRecord; /** @@ -37,6 +38,13 @@ { return 'order'; } + + public function behaviors() + { + return [ + TimestampBehavior::className(), + ]; + } /** * @inheritdoc diff --git a/models/OrderProduct.php b/models/OrderProduct.php index 54c3228..899ee01 100644 --- a/models/OrderProduct.php +++ b/models/OrderProduct.php @@ -37,6 +37,7 @@ [ 'order_id', 'sku', + 'variant_id', ], 'required', ], diff --git a/models/OrderProductSearch.php b/models/OrderProductSearch.php new file mode 100644 index 0000000..785d9ab --- /dev/null +++ b/models/OrderProductSearch.php @@ -0,0 +1,98 @@ + $query, + ] + ); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + // grid filtering conditions + $query->andFilterWhere( + [ + 'id' => $this->id, + 'order_id' => $this->order_id, + 'variant_id' => $this->variant_id, + 'price' => $this->price, + 'count' => $this->count, + ] + ); + + $query->andFilterWhere( + [ + 'like', + 'sku', + $this->sku, + ] + ); + + return $dataProvider; + } + } diff --git a/models/OrderSearch.php b/models/OrderSearch.php new file mode 100644 index 0000000..92888b6 --- /dev/null +++ b/models/OrderSearch.php @@ -0,0 +1,160 @@ +joinWith('orderProducts') + ->with('label.lang') + ->select( + [ + 'order.*', + 'count(*)', + ] + ) + ->groupBy('order.id'); + + // add conditions that should always apply here + + $dataProvider = new ActiveDataProvider( + [ + 'query' => $query, + 'sort' => [ + 'attributes' => [ + 'count', + 'id', + 'user_id', + 'name', + 'label_id', + 'created_at', + 'phone', + 'email', + ], + ], + ] + ); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + // grid filtering conditions + $query->andFilterWhere( + [ + 'id' => $this->id, + 'user_id' => $this->user_id, + 'label_id' => $this->label_id, + 'delivery_id' => $this->delivery_id, + 'payment_id' => $this->payment_id, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + 'deleted_at' => $this->deleted_at, + 'count' => $this->count, + ] + ); + + $query->andFilterWhere( + [ + 'like', + 'name', + $this->name, + ] + ) + ->andFilterWhere( + [ + 'like', + 'phone', + $this->phone, + ] + ) + ->andFilterWhere( + [ + 'like', + 'email', + $this->email, + ] + ) + ->andFilterWhere( + [ + 'like', + 'city', + $this->city, + ] + ) + ->andFilterWhere( + [ + 'like', + 'address', + $this->address, + ] + ) + ->andFilterWhere( + [ + 'like', + 'comment', + $this->comment, + ] + ); + + return $dataProvider; + } + } diff --git a/models/PaymentSearch.php b/models/PaymentSearch.php new file mode 100644 index 0000000..0f21432 --- /dev/null +++ b/models/PaymentSearch.php @@ -0,0 +1,114 @@ +joinWith('lang'); + + // add conditions that should always apply here + + $dataProvider = new ActiveDataProvider( + [ + 'query' => $query, + 'sort' => [ + 'attributes' => [ + 'title' => [ + 'asc' => [ 'payment_lang.title' => SORT_ASC ], + 'desc' => [ 'payment_lang.title' => SORT_DESC ], + ], + 'id', + 'status', + ], + ], + ] + ); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + // grid filtering conditions + $query->andFilterWhere( + [ + 'id' => $this->id, + 'sort' => $this->sort, + 'status' => $this->status, + ] + ); + $query->andFilterWhere( + [ + 'like', + 'payment_lang.title', + $this->title, + ] + ); + + return $dataProvider; + } + } diff --git a/views/delivery/_form.php b/views/delivery/_form.php new file mode 100644 index 0000000..b746efc --- /dev/null +++ b/views/delivery/_form.php @@ -0,0 +1,48 @@ + + +
+ + + + $modelLangs, + 'formView' => '@artbox/order/views/delivery/_form_language', + 'form' => $form, + ] + ) ?> + + field($model, 'sort') + ->textInput() ?> + + field($model, 'value') + ->textInput() ?> + + field($model, 'status') + ->checkbox( + [ + 'class' => 'flat', + ] + ) ?> + +
+ isNewRecord ? Yii::t('order', 'Create') : Yii::t('order', 'Update'), + [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ] + ) ?> +
+ + + +
diff --git a/views/delivery/_form_language.php b/views/delivery/_form_language.php new file mode 100755 index 0000000..4155e7a --- /dev/null +++ b/views/delivery/_form_language.php @@ -0,0 +1,20 @@ +field($model_lang, '[' . $language->id . ']title') + ->textInput([ 'maxlength' => true ]); + + echo $form->field($model_lang, '[' . $language->id . ']description') + ->textarea(); + \ No newline at end of file diff --git a/views/delivery/_search.php b/views/delivery/_search.php new file mode 100644 index 0000000..9d56fa1 --- /dev/null +++ b/views/delivery/_search.php @@ -0,0 +1,36 @@ + + + diff --git a/views/delivery/create.php b/views/delivery/create.php new file mode 100644 index 0000000..0a31fda --- /dev/null +++ b/views/delivery/create.php @@ -0,0 +1,38 @@ +title = Yii::t('order', 'Create Delivery'); + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Deliveries'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + ?> + render( + '_form', + [ + 'model' => $model, + 'modelLangs' => $modelLangs, + ] + ) ?> + + +
diff --git a/views/delivery/index.php b/views/delivery/index.php new file mode 100644 index 0000000..3bc14b4 --- /dev/null +++ b/views/delivery/index.php @@ -0,0 +1,54 @@ +title = Yii::t('order', 'Deliveries'); + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + ?> +

+ 'btn btn-success' ]) ?> +

+ $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], + + 'id', + [ + 'attribute' => 'title', + 'value' => 'lang.title', + ], + 'sort', + 'value', + [ + 'attribute' => 'status', + 'filter' => [ + 0 => \Yii::$app->formatter->asBoolean(false), + 1 => \Yii::$app->formatter->asBoolean(true), + ], + ], + + [ 'class' => 'yii\grid\ActionColumn' ], + ], + ] + ); ?> + +
diff --git a/views/delivery/update.php b/views/delivery/update.php new file mode 100644 index 0000000..4d6be39 --- /dev/null +++ b/views/delivery/update.php @@ -0,0 +1,50 @@ +title = Yii::t( + 'order', + 'Update {modelClass}: ', + [ + 'modelClass' => 'Delivery', + ] + ) . $model->id; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Deliveries'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => $model->id, + 'url' => [ + 'view', + 'id' => $model->id, + ], + ]; + $this->params[ 'breadcrumbs' ][] = Yii::t('order', 'Update'); +?> +
+ $this->title, + ] + ); + ?> + render( + '_form', + [ + 'model' => $model, + 'modelLangs' => $modelLangs, + ] + ) ?> + + +
diff --git a/views/delivery/view.php b/views/delivery/view.php new file mode 100644 index 0000000..53b6413 --- /dev/null +++ b/views/delivery/view.php @@ -0,0 +1,66 @@ +title = $model->id; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Deliveries'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + ?> +

+ $model->id, + ], + [ 'class' => 'btn btn-primary' ] + ) ?> + $model->id, + ], + [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => Yii::t('order', 'Are you sure you want to delete this item?'), + 'method' => 'post', + ], + ] + ) ?> +

+ + $model, + 'attributes' => [ + 'id', + 'lang.title', + 'lang.description', + 'sort', + 'value', + 'status:boolean', + ], + ] + ) ?> + +
diff --git a/views/label/_form.php b/views/label/_form.php new file mode 100644 index 0000000..e1ae73f --- /dev/null +++ b/views/label/_form.php @@ -0,0 +1,49 @@ + + +
+ + + + $modelLangs, + 'formView' => '@artbox/order/views/label/_form_language', + 'form' => $form, + ] + ) ?> + + field($model, 'sort') + ->textInput() ?> + + field($model, 'value') + ->textInput() ?> + + field($model, 'status') + ->checkbox( + [ + 'class' => 'flat', + ] + ) ?> + +
+ isNewRecord ? Yii::t('order', 'Create') : Yii::t('order', 'Update'), + [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ] + ) ?> +
+ + + +
diff --git a/views/label/_form_language.php b/views/label/_form_language.php new file mode 100755 index 0000000..424abde --- /dev/null +++ b/views/label/_form_language.php @@ -0,0 +1,20 @@ +field($model_lang, '[' . $language->id . ']title') + ->textInput([ 'maxlength' => true ]); + + echo $form->field($model_lang, '[' . $language->id . ']description') + ->textarea(); + \ No newline at end of file diff --git a/views/label/_search.php b/views/label/_search.php new file mode 100644 index 0000000..cfad37a --- /dev/null +++ b/views/label/_search.php @@ -0,0 +1,36 @@ + + + diff --git a/views/label/create.php b/views/label/create.php new file mode 100644 index 0000000..096f762 --- /dev/null +++ b/views/label/create.php @@ -0,0 +1,35 @@ +title = Yii::t('order', 'Create Label'); + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Labels'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + echo $this->render( + '_form', + [ + 'model' => $model, + 'modelLangs' => $modelLangs, + ] + ); + $xPanel::end(); + ?> + +
diff --git a/views/label/index.php b/views/label/index.php new file mode 100644 index 0000000..bc43f0a --- /dev/null +++ b/views/label/index.php @@ -0,0 +1,53 @@ +title = Yii::t('order', 'Labels'); + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + ?> +

+ 'btn btn-success' ]) ?> +

+ $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], + + 'id', + [ + 'attribute' => 'title', + 'value' => 'lang.title', + ], + 'value', + [ + 'attribute' => 'status', + 'filter' => [ + 0 => \Yii::$app->formatter->asBoolean(false), + 1 => \Yii::$app->formatter->asBoolean(true), + ], + ], + + [ 'class' => 'yii\grid\ActionColumn' ], + ], + ] + ); ?> + +
diff --git a/views/label/update.php b/views/label/update.php new file mode 100644 index 0000000..c17e447 --- /dev/null +++ b/views/label/update.php @@ -0,0 +1,51 @@ +title = Yii::t( + 'order', + 'Update {modelClass}: ', + [ + 'modelClass' => 'Label', + ] + ) . $model->id; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Labels'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => $model->id, + 'url' => [ + 'view', + 'id' => $model->id, + ], + ]; + $this->params[ 'breadcrumbs' ][] = Yii::t('order', 'Update'); +?> +
+ $this->title, + ] + ); + ?> + render( + '_form', + [ + 'model' => $model, + 'modelLangs' => $modelLangs, + ] + ) ?> + + + +
diff --git a/views/label/view.php b/views/label/view.php new file mode 100644 index 0000000..8d29727 --- /dev/null +++ b/views/label/view.php @@ -0,0 +1,68 @@ +title = $model->lang->title; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Labels'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + ?> +

+ $model->id, + ], + [ 'class' => 'btn btn-primary' ] + ) ?> + $model->id, + ], + [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => Yii::t('order', 'Are you sure you want to delete this item?'), + 'method' => 'post', + ], + ] + ) ?> +

+ + $model, + 'attributes' => [ + 'id', + 'lang.title', + 'lang.description', + 'sort', + 'value', + 'status:boolean', + ], + ] + ) ?> + + + +
diff --git a/views/order-product/_form.php b/views/order-product/_form.php new file mode 100644 index 0000000..d734981 --- /dev/null +++ b/views/order-product/_form.php @@ -0,0 +1,39 @@ + + +
+ + + + field($model, 'order_id') + ->textInput() ?> + + field($model, 'variant_id') + ->textInput() ?> + + field($model, 'sku') + ->textInput([ 'maxlength' => true ]) ?> + + field($model, 'price') + ->textInput() ?> + + field($model, 'count') + ->textInput() ?> + +
+ isNewRecord ? Yii::t('order', 'Create') : Yii::t('order', 'Update'), + [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ] + ) ?> +
+ + + +
diff --git a/views/order-product/_search.php b/views/order-product/_search.php new file mode 100644 index 0000000..a262034 --- /dev/null +++ b/views/order-product/_search.php @@ -0,0 +1,39 @@ + + + diff --git a/views/order-product/create.php b/views/order-product/create.php new file mode 100644 index 0000000..e678f79 --- /dev/null +++ b/views/order-product/create.php @@ -0,0 +1,26 @@ +title = Yii::t('order', 'Create Order Product'); + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Order Products'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ +

title) ?>

+ + render( + '_form', + [ + 'model' => $model, + ] + ) ?> + +
diff --git a/views/order-product/index.php b/views/order-product/index.php new file mode 100644 index 0000000..216c6b6 --- /dev/null +++ b/views/order-product/index.php @@ -0,0 +1,39 @@ +title = Yii::t('order', 'Order Products'); + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ +

title) ?>

+ render('_search', ['model' => $searchModel]); ?> + +

+ 'btn btn-success' ]) ?> +

+ $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], + + 'id', + 'order_id', + 'variant_id', + 'sku', + 'price', + // 'count', + + [ 'class' => 'yii\grid\ActionColumn' ], + ], + ] + ); ?> +
diff --git a/views/order-product/update.php b/views/order-product/update.php new file mode 100644 index 0000000..6d4e3c5 --- /dev/null +++ b/views/order-product/update.php @@ -0,0 +1,39 @@ +title = Yii::t( + 'order', + 'Update {modelClass}: ', + [ + 'modelClass' => 'Order Product', + ] + ) . $model->id; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Order Products'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => $model->id, + 'url' => [ + 'view', + 'id' => $model->id, + ], + ]; + $this->params[ 'breadcrumbs' ][] = Yii::t('order', 'Update'); +?> +
+ +

title) ?>

+ + render( + '_form', + [ + 'model' => $model, + ] + ) ?> + +
diff --git a/views/order-product/view.php b/views/order-product/view.php new file mode 100644 index 0000000..8c976c1 --- /dev/null +++ b/views/order-product/view.php @@ -0,0 +1,59 @@ +title = $model->id; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Order Products'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ +

title) ?>

+ +

+ $model->id, + ], + [ 'class' => 'btn btn-primary' ] + ) ?> + $model->id, + ], + [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => Yii::t('order', 'Are you sure you want to delete this item?'), + 'method' => 'post', + ], + ] + ) ?> +

+ + $model, + 'attributes' => [ + 'id', + 'order_id', + 'variant_id', + 'sku', + 'price', + 'count', + ], + ] + ) ?> + +
diff --git a/views/order/_form.php b/views/order/_form.php new file mode 100644 index 0000000..288f285 --- /dev/null +++ b/views/order/_form.php @@ -0,0 +1,137 @@ + + +
+ + + + isNewRecord) { + echo $form->field($model, 'user_id') + ->textInput(); + } + ?> + + field($model, 'name') + ->textInput([ 'maxlength' => true ]) ?> + + field($model, 'phone') + ->textInput([ 'maxlength' => true ]) ?> + + field($model, 'email') + ->textInput([ 'maxlength' => true ]) ?> + + field($model, 'city') + ->textInput([ 'maxlength' => true ]) ?> + + field($model, 'address') + ->textInput([ 'maxlength' => true ]) ?> + + field($model, 'comment') + ->textInput([ 'maxlength' => true ]) ?> + + field($model, 'label_id') + ->dropDownList($labels) ?> + + field($model, 'delivery_id') + ->dropDownList($deliveries) ?> + + field($model, 'payment_id') + ->dropDownList($payments) ?> + isNewRecord) { + ?> +
+
+
+ +
+
+ +
+
+ +
+
+ + orderProducts as $index => $orderProduct) { + ?> +
+
+ field($orderProduct, "[$index]variant_id") + ->hiddenInput() + ->label(false); + echo $orderProduct->variant->product->lang->title . '(' . $orderProduct->variant->sku . ')'; + ?> +
+
+ price; ?> +
+
+ field($orderProduct, "[$index]count") + ->textInput() + ->label(false); + ?> +
+
+ 'fa fa-', + ] + ), + '#', + [ + 'class' => 'remove-order-product', + ] + ) + ?> +
+
+ +
+
+
+
+
+
+
+ + +
+ isNewRecord ? Yii::t('order', 'Create') : Yii::t('order', 'Update'), + [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ] + ) ?> +
+ + + +
diff --git a/views/order/_search.php b/views/order/_search.php new file mode 100644 index 0000000..5540cad --- /dev/null +++ b/views/order/_search.php @@ -0,0 +1,55 @@ + + + diff --git a/views/order/create.php b/views/order/create.php new file mode 100644 index 0000000..3617d64 --- /dev/null +++ b/views/order/create.php @@ -0,0 +1,41 @@ +title = Yii::t('order', 'Create Order'); + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Orders'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + ?> +

title) ?>

+ + render( + '_form', + [ + 'model' => $model, + ] + ) ?> + + +
diff --git a/views/order/index.php b/views/order/index.php new file mode 100644 index 0000000..5f79067 --- /dev/null +++ b/views/order/index.php @@ -0,0 +1,64 @@ +title = Yii::t('order', 'Orders'); + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ + $this->title, + ] + ); + ?> +

+ 'btn btn-success' ]) ?> +

+ $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], + + 'id', + 'user_id', + 'name', + 'phone', + 'email:email', + [ + 'attribute' => 'label_id', + 'value' => 'label.lang.title', + 'filter' => $labels, + ], + 'created_at:datetime', + [ + 'attribute' => 'count', + 'value' => function ($model) { + /** + * @var \artbox\order\models\Order $model + */ + return count($model->orderProducts); + }, + ], + + [ 'class' => 'yii\grid\ActionColumn' ], + ], + ] + ); ?> + +
diff --git a/views/order/update.php b/views/order/update.php new file mode 100644 index 0000000..eec182e --- /dev/null +++ b/views/order/update.php @@ -0,0 +1,56 @@ +title = Yii::t( + 'order', + 'Update {modelClass}: ', + [ + 'modelClass' => 'Order', + ] + ) . $model->name; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Orders'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => $model->name, + 'url' => [ + 'view', + 'id' => $model->id, + ], + ]; + $this->params[ 'breadcrumbs' ][] = Yii::t('order', 'Update'); +?> +
+ $this->title, + ] + ); + ?> + + render( + '_form', + [ + 'model' => $model, + 'labels' => $labels, + 'payments' => $payments, + 'deliveries' => $deliveries, + ] + ) ?> + + +
diff --git a/views/order/view.php b/views/order/view.php new file mode 100644 index 0000000..d898dfc --- /dev/null +++ b/views/order/view.php @@ -0,0 +1,110 @@ +title = $model->name; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Orders'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + ?> +

+ $model->id, + ], + [ 'class' => 'btn btn-primary' ] + ) ?> + $model->id, + ], + [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => Yii::t('order', 'Are you sure you want to delete this item?'), + 'method' => 'post', + ], + ] + ) ?> +

+ + $model, + 'attributes' => [ + 'id', + 'user_id', + 'name', + 'phone', + 'email:email', + 'city', + 'address', + 'comment', + 'created_at', + 'updated_at', + 'deleted_at', + [ + 'label' => \Yii::t('order', 'Label'), + 'attribute' => 'label.lang.title', + ], + [ + 'label' => \Yii::t('order', 'Delivery'), + 'attribute' => 'delivery.lang.title', + ], + [ + 'label' => \Yii::t('order', 'Payment'), + 'attribute' => 'payment.lang.title', + ], + [ + 'label' => \Yii::t('order', 'Products'), + 'value' => function () use ($model) { + $items = ''; + foreach ($model->orderProducts as $orderProduct) { + $sum = $orderProduct->price * $orderProduct->count; + $items .= Html::tag( + 'li', + Html::a( + $orderProduct->variant->product->lang->title . ' (' . $orderProduct->sku . ')', + [ + 'product/view', + 'id' => $orderProduct->variant->product->id, + ], + [ + 'class' => 'test', + 'target' => '_blank', + ] + ) . ' - ' . $orderProduct->price . 'грн.' . ' * ' . $orderProduct->count . 'x = ' . $sum . 'грн.' + ); + } + return Html::tag('ul', $items); + }, + 'format' => 'html', + ], + ], + ] + ) ?> + + + +
diff --git a/views/payment/_form.php b/views/payment/_form.php new file mode 100644 index 0000000..ed5904c --- /dev/null +++ b/views/payment/_form.php @@ -0,0 +1,46 @@ + + +
+ + + + $modelLangs, + 'formView' => '@artbox/order/views/payment/_form_language', + 'form' => $form, + ] + ) ?> + + field($model, 'sort') + ->textInput() ?> + + field($model, 'status') + ->checkbox( + [ + 'class' => 'flat', + ] + ) ?> + +
+ isNewRecord ? Yii::t('order', 'Create') : Yii::t('order', 'Update'), + [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ] + ) ?> +
+ + + +
diff --git a/views/payment/_form_language.php b/views/payment/_form_language.php new file mode 100755 index 0000000..07f1bd1 --- /dev/null +++ b/views/payment/_form_language.php @@ -0,0 +1,20 @@ +field($model_lang, '[' . $language->id . ']title') + ->textInput([ 'maxlength' => true ]); + + echo $form->field($model_lang, '[' . $language->id . ']description') + ->textarea(); + \ No newline at end of file diff --git a/views/payment/_search.php b/views/payment/_search.php new file mode 100644 index 0000000..1a666a3 --- /dev/null +++ b/views/payment/_search.php @@ -0,0 +1,34 @@ + + + diff --git a/views/payment/create.php b/views/payment/create.php new file mode 100644 index 0000000..49b216c --- /dev/null +++ b/views/payment/create.php @@ -0,0 +1,37 @@ +title = Yii::t('order', 'Create Payment'); + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Payments'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + ?> + render( + '_form', + [ + 'model' => $model, + 'modelLangs' => $modelLangs, + ] + ) ?> + +
diff --git a/views/payment/index.php b/views/payment/index.php new file mode 100644 index 0000000..1e6c05b --- /dev/null +++ b/views/payment/index.php @@ -0,0 +1,53 @@ +title = Yii::t('order', 'Payments'); + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + ?> +

+ 'btn btn-success' ]) ?> +

+ $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], + + 'id', + [ + 'attribute' => 'title', + 'value' => 'lang.title', + ], + 'sort', + [ + 'attribute' => 'status', + 'filter' => [ + 0 => \Yii::$app->formatter->asBoolean(false), + 1 => \Yii::$app->formatter->asBoolean(true), + ], + ], + + [ 'class' => 'yii\grid\ActionColumn' ], + ], + ] + ); ?> + +
diff --git a/views/payment/update.php b/views/payment/update.php new file mode 100644 index 0000000..800bbed --- /dev/null +++ b/views/payment/update.php @@ -0,0 +1,51 @@ +title = Yii::t( + 'order', + 'Update {modelClass}: ', + [ + 'modelClass' => 'Payment', + ] + ) . $model->id; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Payments'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => $model->id, + 'url' => [ + 'view', + 'id' => $model->id, + ], + ]; + $this->params[ 'breadcrumbs' ][] = Yii::t('order', 'Update'); +?> +
+ $this->title, + ] + ); + ?> + render( + '_form', + [ + 'model' => $model, + 'modelLangs' => $modelLangs, + ] + ) ?> + + +
diff --git a/views/payment/view.php b/views/payment/view.php new file mode 100644 index 0000000..b70dc7a --- /dev/null +++ b/views/payment/view.php @@ -0,0 +1,65 @@ +title = $model->id; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => Yii::t('order', 'Payments'), + 'url' => [ 'index' ], + ]; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +
+ $this->title, + ] + ); + ?> +

+ $model->id, + ], + [ 'class' => 'btn btn-primary' ] + ) ?> + $model->id, + ], + [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => Yii::t('order', 'Are you sure you want to delete this item?'), + 'method' => 'post', + ], + ] + ) ?> +

+ + $model, + 'attributes' => [ + 'id', + 'lang.title', + 'lang.description', + 'sort', + 'status:boolean', + ], + ] + ) ?> + +
diff --git a/web/js/order.js b/web/js/order.js new file mode 100644 index 0000000..770d06c --- /dev/null +++ b/web/js/order.js @@ -0,0 +1,9 @@ +$(function() { + $(document) + .on('click', '.remove-order-product', function(e) { + e.preventDefault(); + $(this) + .parents('.row-order-product') + .remove(); + }); +}); \ No newline at end of file -- libgit2 0.21.4