Bläddra i källkod

[backend] Prix : mettre à jour le prix de ProductOrder des distributions futures lors de la modification de Product.

refactoring
Guillaume 4 år sedan
förälder
incheckning
18b2f2e579
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. +4
    -2
      common/models/Distribution.php

+ 4
- 2
common/models/Distribution.php Visa fil

@@ -329,8 +329,10 @@ class Distribution extends ActiveRecordCommon
if($ordersArray) {
foreach($ordersArray as $order) {
foreach($order->productOrder as $productOrder) {
$productOrder->price = $product->price ;
$productOrder->save() ;
if($order->productOrder->id_product == $product->id) {
$productOrder->price = $product->price ;
$productOrder->save() ;
}
}
}
}

Laddar…
Avbryt
Spara