public function actionDelete($id)
    {
        if (!Yii::$app->user->isGuest) {
            if (!empty($id)) {
                $viewedProduct = ViewedProduct::find()
                    ->where(['product_id' => $id, 'user_id' => Yii::$app->user->id])->one();
                if ($viewedProduct->user_id == Yii::$app->user->id) {
                    $viewedProduct->delete();
                    return $this->redirect(['list']);
                }
            }
        } else throw new NotFoundHttpException();
    }