Add InPost Pay integration to admin templates

- Created a new template for the cart rule form with custom label, switch, and choice widgets.
- Implemented the InPost Pay block in the order details template for displaying delivery method, APM, and VAT invoice request.
- Added legacy support for the order details template to maintain compatibility with older PrestaShop versions.
This commit is contained in:
2025-09-14 14:38:09 +02:00
parent d895f86a03
commit 4066f6fa31
1086 changed files with 76598 additions and 6 deletions

View File

@@ -0,0 +1,29 @@
<div class="row mt-n2">
<div class="col-xxl-auto col-12 col-xs-12 mt-2">
{{ form_row(formDisplay) }}
</div>
{% set style_forms = ['maxWidthPx'] %}
{% for name, child in form %}
{% if name not in style_forms %}
<div class="col-xxl col-xl-3 col-sm-6 col-12 col-xs-12 mt-2">
{{ form_row(child) }}
</div>
{% endif %}
{% endfor %}
</div>
<div class="row">
<div class="col-xl-3 col-sm-6 col-12 col-xs-12 mt-2">
{{ form_row(alignmentForm) }}
</div>
{% for child in form %}
{% if not child.rendered %}
<div class="col-xl-3 col-sm-6 col-12 col-xs-12 mt-2">
{{ form_row(child) }}
</div>
{% endif %}
{% endfor %}
</div>

View File

@@ -0,0 +1,34 @@
<p class="h3 mb-3">
{{ form_label(form, null, {
'label_attr': {
'class': 'p-0'
}
}) }}
</p>
{% if form.vars.description is not empty %}
<p class="mb-4">
{{ form.vars.description|raw }}
</p>
{% endif %}
<div class="row row-flex mt-n3">
<div class="col-lg-7 col-md-6 col-12 col-xs-12 mt-3 mr-auto">
{% include '@Modules/inpostizi/views/templates/admin/config/gui/config.html.twig' with {
form: form.widgetConfiguration,
formDisplay: form.displayed,
alignmentForm: form.htmlStyles.justifyContent
} %}
{% include '@Modules/inpostizi/views/templates/admin/config/gui/styles.html.twig' with {
form: form.htmlStyles,
} %}
</div>
<div class="col-lg-4 col-md-6 col-12 col-xs-12 mt-3">
{% include '@Modules/inpostizi/views/templates/admin/config/gui/preview.html.twig' with {
form: form.widgetConfiguration,
} %}
</div>
</div>

View File

@@ -0,0 +1,24 @@
<div class="inpostizi-btn-preview">
<p class="inpostizi-btn-preview__title text-center mb-0">
{{ 'Button preview'|legacy_trans }}
</p>
<p class="small inpostizi-btn-preview__title-subtitle text-center mb-3">
{{ 'In order for the widget preview to be displayed, a valid merchant client ID must be provided in the "Configuration" tab.'|legacy_trans }}
{{ 'Remember to click the \'Save\' button after you finish configuring the button styles'|legacy_trans }}
</p>
{% set btnConfig = form.vars.value %}
{% set type = form.vars.name %}
{% set styleType = btnConfig.darkMode ? 'dark' : 'light' %}
<div
class="js-inpostizi-btn-preview-content inpostizi-btn-preview__content inpostizi-btn-preview__content--{{ styleType }} clearfix"
data-type="{{ type }}"
{% if form.vars.preview_container_styles is defined and form.vars.preview_container_styles is not same as({}) %}
style="{% for name,value in form.vars.preview_container_styles %}{{ name|escape('html_attr') }}:{{ value|escape('html_attr') }};{% endfor %}"
{% endif %}
>
{% include '@Modules/inpostizi/views/templates/admin/config/gui/preview_btn.html.twig'%}
</div>
</div>

View File

@@ -0,0 +1,6 @@
<inpost-izi-button
{% for attr, value in btnConfig %}
{{ attr }}="{{ value }}"
{% endfor %}
>
</inpost-izi-button>

View File

@@ -0,0 +1,10 @@
<div class="row">
{% for child in form %}
{% if not child.rendered %}
<div class="col-xl-3 col-sm-6 col-12 col-xs-12 mt-2">
{{ form_row(child) }}
</div>
{% endif %}
{% endfor %}
</div>