add changes sell product

This commit is contained in:
2015-10-01 17:31:48 +02:00
parent e3d6c0b902
commit e9f9567618
7 changed files with 323 additions and 144 deletions

View File

@@ -125,6 +125,24 @@ class ProductController extends Controller
return $this->redirect(['index']);
}
/**
*/
public function actionLookup($query = null)
{
$result = [];
$product = Product::findProduct($query);
$product = Product::modelToArray($product);
$result['product'] = $product;
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
return $result;
}
/**
* Finds the Product model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.