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

@@ -21,13 +21,15 @@ class UnitType extends AbstractType
{
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->add('unit', ChoiceType::class, [
'required' => true,
'translation_domain'=>'lcshop',
'expanded'=>true,
'data'=> $options['data'],
'choices' => [
'field.default.percent' => 'percent',
'field.default.amount' => 'amount'

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

@@ -36,9 +36,11 @@ abstract class ReductionCredit extends AbstractEntity implements ReductionInterf
protected $merchant;



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

public function __toString()

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

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

Loading…
Cancel
Save