浏览代码

Problème crédit La Marthillaise #308

Il faut toujours s'assurer que le UserProducer existe au moment du tunnel de commande
refactoring
Guillaume Bourgeois 2 年前
父节点
当前提交
21f226de5c
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. +5
    -2
      producer/controllers/OrderController.php

+ 5
- 2
producer/controllers/OrderController.php 查看文件

@@ -760,8 +760,11 @@ class OrderController extends ProducerBaseController
'id_user' => User::getCurrentId()
]);

$json['user'] = false;
if($user && !$userProducer) {
$userProducer = Producer::addUser($user->id, $producer->id);
}

$json['user'] = false;
if ($userProducer) {
$json['user'] = [
'address' => $user->address,
@@ -841,7 +844,7 @@ class OrderController extends ProducerBaseController
$product->getAttributes(),
[
'unit_coefficient' => Product::$unitsArray[$product->unit]['coefficient'],
'prices' => $product->getPriceArray($userProducer->user, $pointSaleCurrent),
'prices' => $product->getPriceArray($user, $pointSaleCurrent),
'productDistribution' => $product['productDistribution'],
'productPointSale' => $product['productPointSale'],
]

正在加载...
取消
保存