소스 검색

Correctif reductionCatalog #14

develop
Fabien Normand 2 년 전
부모
커밋
76e38355c0
2개의 변경된 파일10개의 추가작업 그리고 5개의 파일을 삭제
  1. +1
    -4
      Builder/Order/OrderProductBuilder.php
  2. +9
    -1
      Builder/Order/OrderShopBuilder.php

+ 1
- 4
Builder/Order/OrderProductBuilder.php 파일 보기

@@ -57,12 +57,9 @@ class OrderProductBuilder
return $orderProduct;
}

public function initReductionCatalog(SectionInterface $section, OrderProductInterface $orderProduct, ProductFamilyInterface $productFamily = null): OrderProductInterface
public function initReductionCatalog(SectionInterface $section, OrderProductInterface $orderProduct, ProductFamilyInterface $productFamily): OrderProductInterface
{
if(!$orderProduct->getOrderProductReductionCatalog()) {
if (is_null($productFamily)) {
$productFamily = $orderProduct->getProduct()->getProductFamily();
}

$reductionCatalog = $productFamily->getReductionCatalog();
if ($reductionCatalog && $reductionCatalog->getStatus()) {

+ 9
- 1
Builder/Order/OrderShopBuilder.php 파일 보기

@@ -246,8 +246,16 @@ class OrderShopBuilder
$updated = false;

$this->orderProductBuilder->init($orderProductAdd);
$this->orderProductBuilder->initReductionCatalog($orderShop->getSection(), $orderProductAdd);

//TODO vérifier ma modif ici
if(is_null($orderProductAdd->getOrderProductReductionCatalog())) {
$productFamily = $this->productFamilyStore->setSection($orderShop->getSection())->getOneBySlug(
$orderProductAdd->getProduct()->getProductFamily()->getSlug()
);
if($productFamily) {
$this->orderProductBuilder->initReductionCatalog($orderShop->getSection(), $orderProductAdd, $productFamily);
}
}
foreach ($orderShop->getOrderProducts() as $orderProduct) {
if ($this->orderProductSolver->compare($orderProduct, $orderProductAdd)) {
$orderProduct->setQuantityOrder(

Loading…
취소
저장