Просмотр исходного кода

Pages commandes

feature/export_comptable
Fab 4 лет назад
Родитель
Сommit
a716b18604
3 измененных файлов: 6 добавлений и 2 удалений
  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 Просмотреть файл

@@ -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 Просмотреть файл

@@ -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 Просмотреть файл

@@ -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) }}

Загрузка…
Отмена
Сохранить