diff --git a/backend/assets/ProductAsset.php b/backend/assets/ProductAsset.php index a7a8b04..86a93f1 100644 --- a/backend/assets/ProductAsset.php +++ b/backend/assets/ProductAsset.php @@ -16,6 +16,5 @@ class ProductAsset extends AssetBundle public $depends = [ 'yii\web\YiiAsset', - 'yii\bootstrap\BootstrapAsset', ]; } \ No newline at end of file diff --git a/backend/controllers/ProductController.php b/backend/controllers/ProductController.php index efb4e38..ae5a90f 100644 --- a/backend/controllers/ProductController.php +++ b/backend/controllers/ProductController.php @@ -694,6 +694,7 @@ public function actionUp($id) $product->movePrev(); $this->trigger(self::EVENT_AFTER_EDIT_PRODUCT, new ProductEvent(['id' => $id])); } + if (\Yii::$app->request->isPjax) return $this->actionIndex(); return $this->redirect(\Yii::$app->request->referrer); } else throw new ForbiddenHttpException(\Yii::t('shop', 'You have not permission to do this action.')); } @@ -720,6 +721,7 @@ public function actionDown($id) $product->moveNext(); $this->trigger(self::EVENT_AFTER_EDIT_PRODUCT, new ProductEvent(['id' => $id])); } + if (\Yii::$app->request->isPjax) return $this->actionIndex(); return $this->redirect(\Yii::$app->request->referrer); } else throw new ForbiddenHttpException(\Yii::t('shop', 'You have not permission to do this action.')); } @@ -751,6 +753,8 @@ public function actionDelete($id) $product->delete(); $this->trigger(self::EVENT_AFTER_DELETE_PRODUCT, new ProductEvent(['id' => $id])); + + if (\Yii::$app->request->isPjax) return $this->actionIndex(); return $this->redirect('index'); } else throw new ForbiddenHttpException(\Yii::t('shop', 'You have not permission to delete this product.')); } diff --git a/backend/views/product/index.php b/backend/views/product/index.php index 2bc0a4d..d493684 100644 --- a/backend/views/product/index.php +++ b/backend/views/product/index.php @@ -34,7 +34,11 @@ Yii::t('shop', 'Products') ]; ?> - + 'p-products', + 'linkSelector' => '.pjax', + 'enablePushState' => false +]); ?>