Quellcode durchsuchen

ErrorException: A non-numeric value encountered in OrderController.php l. 829 #1174

feature/souke
Guillaume Bourgeois vor 1 Jahr
Ursprung
Commit
c1bbdbd7a6
1 geänderte Dateien mit 21 neuen und 19 gelöschten Zeilen
  1. +21
    -19
      backend/controllers/OrderController.php

+ 21
- 19
backend/controllers/OrderController.php Datei anzeigen

@@ -826,26 +826,28 @@ class OrderController extends BackendController

foreach ($products as $key => $dataProductOrder) {
$product = $productManager->findOneProductById($key);
$quantity = $dataProductOrder->quantity / Product::$unitsArray[$dataProductOrder->unit]['coefficient'];
if ($product && $quantity) {
$productOrder = new ProductOrder;
$productOrder->id_order = $order->id;
$productOrder->id_product = $key;
$productOrder->quantity = $quantity;
$productOrder->unit = $product->unit;
$productOrder->step = $product->step;
if ($dataProductOrder->price) {
$productOrder->price = $dataProductOrder->price;
} else {
$productOrder->price = $productManager->getPrice($product, [
'user' => $user,
'user_producer' => $userProducer,
'point_sale' => $order->pointSale,
'quantity' => $productOrder->quantity
]);
if(isset(Product::$unitsArray[$dataProductOrder->unit]) && Product::$unitsArray[$dataProductOrder->unit]['coefficient']) {
$quantity = $dataProductOrder->quantity / Product::$unitsArray[$dataProductOrder->unit]['coefficient'];
if ($product && $quantity) {
$productOrder = new ProductOrder;
$productOrder->id_order = $order->id;
$productOrder->id_product = $key;
$productOrder->quantity = $quantity;
$productOrder->unit = $product->unit;
$productOrder->step = $product->step;
if ($dataProductOrder->price) {
$productOrder->price = $dataProductOrder->price;
} else {
$productOrder->price = $productManager->getPrice($product, [
'user' => $user,
'user_producer' => $userProducer,
'point_sale' => $order->pointSale,
'quantity' => $productOrder->quantity
]);
}
$productOrder->id_tax_rate = $product->taxRate->id;
$productOrder->save();
}
$productOrder->id_tax_rate = $product->taxRate->id;
$productOrder->save();
}
}


Laden…
Abbrechen
Speichern