{% extends 'layouts/app.html.twig' %} {% block title %}Profile wariantów{% endblock %} {% block app_content %} {% include 'partials/_flash_messages.html.twig' %}

Słowniki / Mapowania

{{ editing_profile ? 'Edytuj profil wariantów' : 'Profile wariantów' }}

Profil wariantów opisuje wyłącznie wartości atrybutów i ich szczegółowe zachowanie: impact ceny, ilość oraz reference. Warunki użycia profilu, czyli platformę, typ produktu, cenę bazową, ilość bazową i tryb wariantów, ustawiasz w Mapowanie → Ustawienia domyślne. Dzięki temu nie dublujemy logiki w dwóch miejscach.

Profil wartości

{{ editing_profile ? 'Zmień profil' : 'Dodaj profil' }}

Zaznacz wartości atrybutów, z których mają powstać kombinacje. Dla każdej wartości możesz ustawić impact ceny, ilość oraz wzór reference. Reference obsługuje zmienne: {symbol}, {base_reference}, {variant}, {variant_label}, {value}.

{{ form_start(form, { attr: { class: 'stack-form', 'data-turbo': 'false' } }) }}
{{ form_row(form.code) }} {{ form_row(form.name) }} {{ form_row(form.active) }}
{{ form_row(form.description) }}

Wartości są grupowane po grupie atrybutów PrestaShop. Kombinacje powstaną dopiero wtedy, gdy profil zostanie wskazany w ustawieniu domyślnym dla konkretnej platformy i typu produktu.

profil = wartości + zasady
{{ form_errors(form.attributeValues) }}
{% for value in form.attributeValues %} {% set value_id = value.vars.value %} {% set value_settings = profile_item_settings[value_id]|default({}) %}
{% endfor %}
{% if editing_profile %} Anuluj edycję {% endif %}
{{ form_end(form) }}

Profile do wykorzystania w mapowaniu

Lista profili wariantów

Te profile nie są już dopasowywane samodzielnie po platformie i typie produktu. Wybierasz je w Mapowanie → Ustawienia domyślne. Jeśli przy projekcie nie ma JSON-a i reguła domyślna ma tryb „Profil wariantów”, aplikacja użyje wskazanego tutaj profilu.

{% for item in items %} {% else %} {% endfor %}
Kod Nazwa Wartości Kombinacje Ustawienia wartości Aktywny Akcje
{{ item.code }} {{ item.name }} {% if item.description %} {{ item.description|striptags|slice(0, 120) }} {% endif %} {{ item.items|length }} w {{ item.attributeGroupsCount() }} grupach {% set combinations_count = item.expectedCombinationsCount() %} {% if combinations_count > 0 %} {{ combinations_count }} {% else %} 0 {% endif %}
{% set priced = 0 %} {% set quantified = 0 %} {% set referenced = 0 %} {% for profile_item in item.items %} {% if profile_item.priceImpact is not null %}{% set priced = priced + 1 %}{% endif %} {% if profile_item.quantity is not null %}{% set quantified = quantified + 1 %}{% endif %} {% if profile_item.referencePattern is not null %}{% set referenced = referenced + 1 %}{% endif %} {% endfor %} impact: {{ priced }} ilość: {{ quantified }} ref: {{ referenced }}
{% if item.active %} tak {% else %} nie {% endif %}
Edytuj
Brak profili wariantów.
{% endblock %}