Commit d5d1cb7a5fbbd63ed86ea3cf8528fd63d603bc55

Authored by Eugeny Galkovskiy
1 parent a2be93a4

123

backend/config/main.php
... ... @@ -156,8 +156,9 @@ return [
156 156 'rubrication/tax-group/<action>/<level:[0-9]+>/<id:[A-Za-z0-9_-]+>' => 'rubrication/tax-group/<action>',
157 157 'rubrication/tax-group/<action>/<level:[0-9]+>' => 'rubrication/tax-group/<action>',
158 158 'product/manage/<action>' => 'product/manage/<action>',
159   - 'product/<controller>/<action>/<product_id:[A-Za-z0-9_-]+>/' => 'product/<controller>/<action>',
160 159 'product/<controller>/<action>/<product_id:[A-Za-z0-9_-]+>/<id:[A-Za-z0-9_-]+>' => 'product/<controller>/<action>',
  160 + 'product/<controller>/<action>/<product_id:[A-Za-z0-9_-]+>/' => 'product/<controller>/<action>',
  161 +
161 162 'product/<action>/<product_id:[A-Za-z0-9_-]+>' => 'product/<action>',
162 163 'seo-dynamic/<action>/<seo_category_id:[A-Za-z0-9_-]+>/<id:[A-Za-z0-9_-]+>' => 'seo-dynamic/<action>',
163 164 'seo-dynamic/<action>/<seo_category_id:[A-Za-z0-9_-]+>' => 'seo-dynamic/<action>',
... ...
common/modules/product/controllers/VariantController.php
... ... @@ -198,11 +198,12 @@ class VariantController extends Controller
198 198 * @param integer $id
199 199 * @return mixed
200 200 */
201   - public function actionDelete($id)
  201 + public function actionDelete($product_id, $id)
202 202 {
  203 +
203 204 $this->findModel($id)->delete();
204 205  
205   - return $this->redirect(['index']);
  206 + return $this->redirect(['index', 'product_id'=>$product_id]);
206 207 }
207 208  
208 209 public function actionDelimg($id)
... ...
common/modules/product/models/ProductVariant.php
... ... @@ -276,6 +276,7 @@ class ProductVariant extends \yii\db\ActiveRecord
276 276 public function beforeDelete() {
277 277 ProductImage::deleteAll(['product_variant_id' => $this->product_variant_id]);
278 278 ProductStock::deleteAll(['product_variant_id' => $this->product_variant_id]);
  279 + return true;
279 280 }
280 281  
281 282 public function imagesUpload()
... ...