diff --git a/app/services/vendor_product_service.py b/app/services/vendor_product_service.py index d03a3646..acf19372 100644 --- a/app/services/vendor_product_service.py +++ b/app/services/vendor_product_service.py @@ -192,6 +192,19 @@ class VendorProductService: "description": t.description, } + # Convenience fields for UI (prefer vendor translations, fallback to English) + title = None + description = None + if vendor_translations: + # Try English first, then first available language + if "en" in vendor_translations: + title = vendor_translations["en"].get("title") + description = vendor_translations["en"].get("description") + elif vendor_translations: + first_lang = next(iter(vendor_translations)) + title = vendor_translations[first_lang].get("title") + description = vendor_translations[first_lang].get("description") + return { "id": product.id, "vendor_id": product.vendor_id, @@ -233,6 +246,11 @@ class VendorProductService: # Translations "marketplace_translations": mp_translations, "vendor_translations": vendor_translations, + # Convenience fields for UI display + "title": title, + "description": description, + "image_url": product.primary_image_url, + "additional_images": product.additional_images or [], # Timestamps "created_at": product.created_at.isoformat() if product.created_at