diff --git a/src/app/blueprints/admin/routes.py b/src/app/blueprints/admin/routes.py index d9058a4..01c6bab 100644 --- a/src/app/blueprints/admin/routes.py +++ b/src/app/blueprints/admin/routes.py @@ -108,29 +108,6 @@ def add_product(tenant_id): "fieldType": field['fieldType'] }) - # Handle backward compatibility fields - if '_name' not in [f['fieldName'] for f in custom_fields]: - name = request.form.get('name', '') - if name: - product_data.append({ - "fieldName": "_name", - "label": "Product Name", - "value": name, - "editable": "true", - "fieldType": "TEXT" - }) - - if '_price' not in [f['fieldName'] for f in custom_fields]: - price = request.form.get('price', '') - if price: - product_data.append({ - "fieldName": "_price", - "label": "Sale Price", - "value": f"${price}", - "editable": "true", - "fieldType": "TEXT" - }) - # Save to database ProductModel.save(product_id, tenant_id, product_data, image_data, image_mime_type) @@ -235,25 +212,6 @@ def edit_product(tenant_id, product_id): updated_product.append(existing_field) - # Handle backward compatibility fields - if '_name' not in [f['fieldName'] for f in custom_fields]: - name = request.form.get('name', '') - if name: - for field in products[product_id]: - if field["fieldName"] == "_name": - field["value"] = name - updated_product.append(field) - break - - if '_price' not in [f['fieldName'] for f in custom_fields]: - price = request.form.get('price', '') - if price: - for field in products[product_id]: - if field["fieldName"] == "_price": - field["value"] = f"${price}" - updated_product.append(field) - break - # Save to database ProductModel.save(product_id, tenant_id, updated_product, image_data, image_mime_type) diff --git a/src/app/templates/admin/add_product.html b/src/app/templates/admin/add_product.html index 7df582f..4aac9f1 100644 --- a/src/app/templates/admin/add_product.html +++ b/src/app/templates/admin/add_product.html @@ -62,25 +62,7 @@ {% endif %} {% endfor %} - - - {% if not custom_fields|selectattr('fieldName', 'equalto', '_name')|list %} -
- - -
- {% endif %} - - {% if not custom_fields|selectattr('fieldName', 'equalto', '_price')|list %} -
- -
- $ - -
-
- {% endif %} - +
Cancel diff --git a/src/app/templates/admin/edit_product.html b/src/app/templates/admin/edit_product.html index a2f3680..9aa37fe 100644 --- a/src/app/templates/admin/edit_product.html +++ b/src/app/templates/admin/edit_product.html @@ -60,35 +60,7 @@
{% endif %} {% endfor %} - - - {% if not custom_fields|selectattr('fieldName', 'equalto', '_name')|list %} - {% for field in product %} - {% if field.fieldName == '_name' %} -
- - -
- {% endif %} - {% endfor %} - {% endif %} - - {% if not custom_fields|selectattr('fieldName', 'equalto', '_price')|list %} - {% for field in product %} - {% if field.fieldName == '_price' %} -
- -
- $ - {% set price_value = field.value|replace('$', '') %} - -
-
- {% endif %} - {% endfor %} - {% endif %} - +
Cancel