Exemplo n.º 1
0
 public function actionUpdatefromcart($id, $quantity)
 {
     $cart = Yii::$app->cart;
     $model = SapCode::findOne($id);
     if ($model) {
         $cart->update($model, $quantity);
         //die(print_r($cart));
         return $this->redirect(['viewcart']);
     }
     throw new NotFoundHttpException();
 }
Exemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSapCodes()
 {
     return $this->hasMany(SapCode::className(), ['product_id' => 'id']);
 }