/**
  * @return \yii\db\ActiveQuery
  */
 public function getCarts()
 {
     return $this->hasMany(Cart::className(), ['customer_user_name' => 'customer_user_name']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCarts()
 {
     return $this->hasMany(Cart::className(), ['item_id' => 'item_id']);
 }
 public function actionAddcart()
 {
     $cart = Cart::find()->where(['customer_user_name' => 'greg chappel'])->all();
     $items_details = [];
     $itemName = [];
     $count1 = 0;
     foreach ($cart as $c) {
         $items_details[$count1] = ItemDetails::find()->where(['idetails_id' => $c->idetails_id])->one();
         $count1++;
     }
     foreach ($items_details as $item) {
         $itemName[$item->idetails_id] = Item::find()->where(['item_id' => $item->item_id])->one();
     }
     return $this->render('addcart', ['items_details' => $items_details, 'itemName' => $itemName]);
 }