Browse Source

Pages commandes

feature/export_comptable
Fab 4 years ago
parent
commit
a716b18604
3 changed files with 6 additions and 2 deletions
  1. +3
    -1
      ShopBundle/Form/Backend/ReductionCommon/UnitType.php
  2. +2
    -0
      ShopBundle/Model/ReductionCredit.php
  3. +1
    -1
      ShopBundle/Resources/views/backend/reductioncart/panel_actions.html.twig

+ 3
- 1
ShopBundle/Form/Backend/ReductionCommon/UnitType.php View File

{ {
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
dump($options);
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event, $options) {
$builder = $event->getForm()->getParent(); $builder = $event->getForm()->getParent();


$builder->add('unit', ChoiceType::class, [ $builder->add('unit', ChoiceType::class, [
'required' => true, 'required' => true,
'translation_domain'=>'lcshop', 'translation_domain'=>'lcshop',
'expanded'=>true, 'expanded'=>true,
'data'=> $options['data'],
'choices' => [ 'choices' => [
'field.default.percent' => 'percent', 'field.default.percent' => 'percent',
'field.default.amount' => 'amount' 'field.default.amount' => 'amount'

+ 2
- 0
ShopBundle/Model/ReductionCredit.php View File

protected $merchant; protected $merchant;





public function __construct() public function __construct()
{ {
$this->users = new ArrayCollection(); $this->users = new ArrayCollection();
$this->unit = 'amount';
} }


public function __toString() public function __toString()

+ 1
- 1
ShopBundle/Resources/views/backend/reductioncart/panel_actions.html.twig View File

<div class="col-12"> <div class="col-12">
{{ form_row(form.appliedTo, {"attr" :{"v-model" : 'reductionAppliedTo'}}) }} {{ form_row(form.appliedTo, {"attr" :{"v-model" : 'reductionAppliedTo'}}) }}
</div> </div>
<div class="col-12" v-show="reductionAppliedTo != 'shipping'">
<div class="col-12" v-show="reductionAppliedTo != 'delivery'">
{{ form_row(form.freeShipping) }} {{ form_row(form.freeShipping) }}
</div> </div>
{{ macros.fieldReductionUnit(form) }} {{ macros.fieldReductionUnit(form) }}

Loading…
Cancel
Save