Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

62 linhas
3.8KB

  1. {{ form_start(form) }}
  2. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  3. {% set formValues = form.vars.value %}
  4. <div id="lc-reduction-cart-edit">
  5. <div class="card card-light">
  6. <div class="lc-vue-js-container card-header p-0 border-bottom-0">
  7. <ul class="nav nav-tabs" id="nav-params">
  8. <li class="nav-item" v-for="section in sectionsArray">
  9. <button type="button"
  10. :class="'btn '+((currentSection == section.name) ? 'btn btn-primary' : 'btn ')"
  11. @click="changeSection(section)">
  12. ${ section.nameDisplay }
  13. <span class="glyphicon glyphicon-triangle-bottom"></span>
  14. <i class="fa fa-exclamation-circle invalid-form"></i>
  15. </button>
  16. </li>
  17. </ul>
  18. </div>
  19. </div>
  20. <div class="form ">
  21. <script>
  22. window.reductionCartCodesUsed = {{ list_reduction_codes()|json_encode|raw }};
  23. window.reductionCartValues = {
  24. {% if formValues.permanent is not null and formValues.permanent == false %}reductionPermanent: false,{% endif %}
  25. {% if formValues.behaviorTaxRate %}reductionBehaviorTaxRate: '{{ formValues.behaviorTaxRate }}',{% endif %}
  26. {% if formValues.value %}reductionValue: parseFloat({{ formValues.value }}),{% endif %}
  27. {% if formValues.unit %}reductionUnit: "{{ formValues.unit }}",{% endif %}
  28. {% if formValues.appliedTo %}reductionAppliedTo: "{{ formValues.appliedTo }}",{% endif %}
  29. {% if formValues.groupUsers is not empty %}reductionGroupUsersActive: true,{% endif %}
  30. {% if formValues.groupUsers is not empty %}reductionGroupUsers: {{ formValues.groupUsers|json_encode }},{% endif %}
  31. {% if formValues.users is not empty %}reductionUsersActive: true,{% endif %}
  32. {% if formValues.users is not empty %}reductionUsers: {{ formValues.users|json_encode }},{% endif %}
  33. {% if formValues.pointSales is not empty %}reductionPointSalesActive: true,{% endif %}
  34. {% if formValues.pointSales is not empty %}reductionPointSales: {{ formValues.pointSales|json_encode }},{% endif %}
  35. {% if formValues.deliveryZones is not empty %}reductionDeliveryZonesActive: true,{% endif %}
  36. {% if formValues.deliveryZones is not empty %}reductionDeliveryZones: {{ formValues.deliveryZones|json_encode }},{% endif %}
  37. {% if formValues.deliverySlots is not empty %}reductionDeliverySlotsActive: true,{% endif %}
  38. {% if formValues.deliverySlots is not empty %}reductionDeliverySlots: {{ formValues.deliverySlots|json_encode }},{% endif %}
  39. {% if formValues.uncombinables is not empty or formValues.uncombinableTypes %}reductionCombinable: true,{% endif %}
  40. {% if formValues.uncombinables is not empty %}reductionUncombinables: {{ formValues.uncombinables|json_encode }},{% endif %}
  41. {% if formValues.uncombinableTypes is not empty %}reductionUncombinableTypes: {{ formValues.uncombinableTypes|json_encode }},{% endif %}
  42. }
  43. </script>
  44. <div v-show="currentSection == 'info'" class="panel panel-default">
  45. {% include '@LcShop/backend/reductioncart/panel_info.html.twig' %}
  46. </div>
  47. <div v-show="currentSection == 'conditions'" class="panel panel-default">
  48. {% include '@LcShop/backend/reductioncart/panel_conditions.html.twig' %}
  49. </div>
  50. <div v-show="currentSection == 'actions'" class="panel panel-default">
  51. {% include '@LcShop/backend/reductioncart/panel_actions.html.twig' %}
  52. </div>
  53. </div>
  54. </div>
  55. {{ form_end(form) }}