Browse Source

Implémantation distribution

packProduct
Fab 3 years ago
parent
commit
fdda030e6d
5 changed files with 24 additions and 2 deletions
  1. +2
    -0
      Controller/ControllerTrait.php
  2. +4
    -0
      Generator/OrderReferenceGenerator.php
  3. +1
    -0
      Repository/Distribution/DistributionStore.php
  4. +4
    -1
      Resources/views/admin/product/field/product_family_sales.html.twig
  5. +13
    -1
      Solver/Merchant/MerchantSolver.php

+ 2
- 0
Controller/ControllerTrait.php View File

@@ -6,6 +6,7 @@ use Lc\CaracoleBundle\Container\Address\AddressContainer;
use Lc\CaracoleBundle\Container\Config\TaxRateContainer;
use Lc\CaracoleBundle\Container\Config\UnitContainer;
use Lc\CaracoleBundle\Container\Credit\CreditHistoryContainer;
use Lc\CaracoleBundle\Container\Distribution\DistributionContainer;
use Lc\CaracoleBundle\Container\File\DocumentContainer;
use Lc\CaracoleBundle\Container\Merchant\MerchantContainer;
use Lc\CaracoleBundle\Container\Order\OrderPaymentContainer;
@@ -85,6 +86,7 @@ trait ControllerTrait
UserMerchantContainer::class => UserMerchantContainer::class,
UserPointSaleContainer::class => UserPointSaleContainer::class,
VisitorContainer::class => VisitorContainer::class,
DistributionContainer::class => DistributionContainer::class,
]
);
}

+ 4
- 0
Generator/OrderReferenceGenerator.php View File

@@ -78,3 +78,7 @@ class OrderReferenceGenerator
}

}





+ 1
- 0
Repository/Distribution/DistributionStore.php View File

@@ -48,4 +48,5 @@ class DistributionStore extends AbstractStore

return $query->findOne();
}

}

+ 4
- 1
Resources/views/admin/product/field/product_family_sales.html.twig View File

@@ -1,3 +1,6 @@
{% import '@LcCaracole/admin/product/macro/product_family_macro.html.twig' as pfm %}
{% set section_current = section_container.resolver.getCurrent() %}
{{ pfm.product_family_sales_statistic(order_shop_container.builder.getProductsSalesStatistic(section_current, entity.instance, 2), entity.instance) }}
{% set distribution = distribution_container.builder.guessCurrentDistributionDelivery(section_current) %}

{#
{{ pfm.product_family_sales_statistic(order_shop_container.builder.getProductsSalesStatistic(section_current, entity.instance, 2), entity.instance) }}#}

+ 13
- 1
Solver/Merchant/MerchantSolver.php View File

@@ -18,4 +18,16 @@ class MerchantSolver

return $newsletterArray;
}
}

public function getSectionsOnline(MerchantInterface $merchant):array{
$sectionArray = [];

foreach($merchant->getSections() as $section) {
if($section->getStatus() === 1){
$sectionArray[] = $section;
}
}

return $sectionArray;
}
}

Loading…
Cancel
Save