Feat: Product Variations page get, filter, and save. \n Fix: Active column changed to Add / Delete / Undelete column - this change has only been applied to Product Variations page

This commit is contained in:
2024-11-09 13:41:08 +00:00
parent 8c4efc73da
commit 60431062f0
105 changed files with 12154 additions and 741 deletions

View File

@@ -0,0 +1,21 @@
{% with _is_blank_row = (is_blank_row or variation_type is not defined or variation_type.variations is none or variation_type.variations == [] or is_blank_row is not defined) %}
{% if not _is_blank_row %}
{# {% set ids_variation = variation_type.get_str_list_ids_variation() %} #}
<div class="{{ model.FLAG_PRODUCT_VARIATIONS }}"
{#
{{ model.ATTR_VALUE_CURRENT }}="{{ ids_variation }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ ids_variation }}"
#}
>
{#
{{ variation_type.get_preview_variations() }}
#}
{% for variation in variation_type.variations %}
{{ variation.name }}<br>
{% endfor %}
</div>
{% else %}
<div class="{{ model.FLAG_PRODUCT_VARIATIONS }}"></div>
{% endif %}
{% endwith %}

View File

@@ -1,6 +1,6 @@
{% with _is_blank_row = (is_blank_row or variation_tree is not defined or is_blank_row is not defined) %}
{% if not is_blank_row %}
{% if not _is_blank_row %}
{# % set json_str_variation_types = product.get_json_str_types_variation_trees() % #}
{% set names_variation_type = product.get_variation_types_unique() %}
{% set json_str_variation_types = jsonify(names_variation_type) %}

View File

@@ -1,5 +1,5 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_PRODUCT }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }}>
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_PRODUCT }}" {{ model.ATTR_ID_PRODUCT }}>
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
{% include 'components/common/buttons/_slider_display_order.html' %}
</td>

View File

@@ -0,0 +1,65 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_PRODUCT_VARIATION_TYPE }}" {{ model.ATTR_ID_PRODUCT_VARIATION_TYPE }}>
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
{% include 'components/common/buttons/_slider_display_order.html' %}
</td>
<td class="{{ model.FLAG_CODE }}">
<textarea class="{{ model.FLAG_CODE }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
<td class="{{ model.FLAG_NAME }}">
<textarea class="{{ model.FLAG_NAME }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
<td class="{{ model.FLAG_NAME_PLURAL }}">
<textarea class="{{ model.FLAG_NAME_PLURAL }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
<td class="{{ model.FLAG_PRODUCT_VARIATIONS}} {{ model.FLAG_COLLAPSED }}">
{% include 'components/store/_preview_product_variation_type_variations.html' %}
</td>
<td class="{{ model.FLAG_ACTIVE }}">
{#
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}">
#}
<button type="button" class="{{ model.FLAG_ACTIVE }} {{ model.FLAG_DELETE }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}"
>x</button>
</td>
</tr>
{% else %}
<tr class="{{ model.FLAG_PRODUCT_VARIATION_TYPE }}" {{ model.ATTR_ID_PRODUCT_VARIATION_TYPE }}="{{ variation_type.id_type }}">
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
{% set display_order = variation_type.display_order %}
{% include 'components/common/buttons/_slider_display_order.html' %}
</td>
<td class="{{ model.FLAG_CODE }}">
<textarea class="{{ model.FLAG_CODE }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.code }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.code }}"
>{{ variation_type.code }}</textarea>
</td>
<td class="{{ model.FLAG_NAME }}">
<textarea class="{{ model.FLAG_NAME }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.name_singular }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.name_singular }}"
>{{ variation_type.name_singular }}</textarea>
</td>
<td class="{{ model.FLAG_NAME_PLURAL }}">
<textarea class="{{ model.FLAG_NAME_PLURAL }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.name_plural }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.name_plural }}"
>{{ variation_type.name_plural }}</textarea>
</td>
<td class="{{ model.FLAG_PRODUCT_VARIATIONS}} {{ model.FLAG_COLLAPSED }}">
{% include 'components/store/_preview_product_variation_type_variations.html' %}
</td>
<td class="{{ model.FLAG_ACTIVE }}">
{#
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if variation_type.active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.active | lower }}">
#}
<button type="button" class="{{ model.FLAG_ACTIVE }} {% if variation_type.active %}{{ model.FLAG_DELETE }}{% endif %}"
{{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.active | lower }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.active | lower }}"
>{% if variation_type.active %}x{% else %}+{% endif %}</button>
</td>
</tr>
{% endif %}