Commit 5b78178b6b99d513c9d837dc26e22ff62b231ef9
1 parent
25849d7b
product
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
frontend/controllers/BasketController.php
... | ... | @@ -43,14 +43,14 @@ class BasketController extends Controller |
43 | 43 | if ($modelOrder->load(Yii::$app->request->post()) && $modelOrder->save()) { |
44 | 44 | $productV = $_POST['ProductVariant']; |
45 | 45 | |
46 | - foreach ($_POST['ProductVariant'] as $index=>$row) { | |
46 | + foreach ($productV as $index=>$row) { | |
47 | 47 | $modelOrdersProducts = new OrdersProducts(); |
48 | 48 | $mod_id = $row['id']; |
49 | 49 | unset($row['id']); |
50 | 50 | $data['OrdersProducts'] = $row; |
51 | 51 | $data['OrdersProducts']['mod_id'] = $mod_id; |
52 | 52 | $data['OrdersProducts']['order_id'] = $modelOrder->id; |
53 | - $OrdersProducts[] = ProductVariant::findOne($mod_id); | |
53 | + $productV[$index]['img'] = ProductVariant::findOne($mod_id)->images->images; | |
54 | 54 | $modelOrdersProducts->load($data); |
55 | 55 | $modelOrdersProducts->save(); |
56 | 56 | } | ... | ... |