Browse Source

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

dev
Guillaume 4 years ago
parent
commit
18b2f2e579
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      common/models/Distribution.php

+ 4
- 2
common/models/Distribution.php View File

if($ordersArray) { if($ordersArray) {
foreach($ordersArray as $order) { foreach($ordersArray as $order) {
foreach($order->productOrder as $productOrder) { foreach($order->productOrder as $productOrder) {
$productOrder->price = $product->price ;
$productOrder->save() ;
if($order->productOrder->id_product == $product->id) {
$productOrder->price = $product->price ;
$productOrder->save() ;
}
} }
} }
} }

Loading…
Cancel
Save