From dee2eab2668fa1d0bd1b08f12d8e2bc2cefb82e8 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Tue, 19 May 2026 22:15:15 +0200 Subject: [PATCH] fix(loyalty): conditional subtitle on enrollment success page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When re-enrolling (already a member), the success page showed two contradicting messages stacked: Title: "Vous êtes déjà membre !" (correct, conditional) Subtitle: "Vous êtes maintenant membre..." (wrong — static) The title was already x-text-conditional based on enrollContext.already_enrolled, but the subtitle was a server-side {{ _('success.message') }} so it always rendered the "you're now a member" copy regardless of branch. Make the subtitle conditional the same way: - new i18n key already_enrolled_message in en/fr/de/lb ("Welcome back — your card is ready whenever you are." and locale-appropriate equivalents) - expose success_message + already_enrolled_message in i18nStrings - subtitle becomes x-text="already_enrolled ? msg2 : msg1" Found during Test 2 round 2 — cross-store re-enrollment at FASHIONOUTLET with the email from Test 1. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/modules/loyalty/locales/de.json | 1 + app/modules/loyalty/locales/en.json | 1 + app/modules/loyalty/locales/fr.json | 1 + app/modules/loyalty/locales/lb.json | 1 + .../templates/loyalty/storefront/enroll-success.html | 7 ++++++- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/modules/loyalty/locales/de.json b/app/modules/loyalty/locales/de.json index 61fb24c8..fb432455 100644 --- a/app/modules/loyalty/locales/de.json +++ b/app/modules/loyalty/locales/de.json @@ -137,6 +137,7 @@ "back_to_home": "Zurück zur Startseite" }, "already_enrolled_title": "Sie sind bereits Mitglied!", + "already_enrolled_message": "Willkommen zurück — Ihre Karte ist einsatzbereit.", "cross_location_message": "Ihre Karte gilt an allen unseren Standorten:", "single_location_message": "Ihre Karte ist bei {store_name} registriert", "available_locations": "Nutzen Sie Ihre Karte an allen unseren Standorten:", diff --git a/app/modules/loyalty/locales/en.json b/app/modules/loyalty/locales/en.json index 631f3cec..98af46e6 100644 --- a/app/modules/loyalty/locales/en.json +++ b/app/modules/loyalty/locales/en.json @@ -137,6 +137,7 @@ "back_to_home": "Back to Home" }, "already_enrolled_title": "You're already a member!", + "already_enrolled_message": "Welcome back — your card is ready whenever you are.", "cross_location_message": "Your card works at all our locations:", "single_location_message": "Your card is registered at {store_name}", "available_locations": "Use your card at all our locations:", diff --git a/app/modules/loyalty/locales/fr.json b/app/modules/loyalty/locales/fr.json index 7ea73081..9a0301d1 100644 --- a/app/modules/loyalty/locales/fr.json +++ b/app/modules/loyalty/locales/fr.json @@ -137,6 +137,7 @@ "back_to_home": "Retour à l'accueil" }, "already_enrolled_title": "Vous êtes déjà membre !", + "already_enrolled_message": "Heureux de vous revoir — votre carte est prête à l'emploi.", "cross_location_message": "Votre carte est valable dans tous nos points de vente :", "single_location_message": "Votre carte est enregistrée chez {store_name}", "available_locations": "Utilisez votre carte dans tous nos points de vente :", diff --git a/app/modules/loyalty/locales/lb.json b/app/modules/loyalty/locales/lb.json index 95f61476..d4b4548f 100644 --- a/app/modules/loyalty/locales/lb.json +++ b/app/modules/loyalty/locales/lb.json @@ -137,6 +137,7 @@ "back_to_home": "Zréck op d'Haaptsäit" }, "already_enrolled_title": "Dir sidd schonn Member!", + "already_enrolled_message": "Wëllkomm zréck — Är Kaart ass prett wann Dir et sidd.", "cross_location_message": "Är Kaart gëllt an all eise Standuerter:", "single_location_message": "Är Kaart ass bei {store_name} registréiert", "available_locations": "Benotzt Är Kaart an all eise Standuerter:", diff --git a/app/modules/loyalty/templates/loyalty/storefront/enroll-success.html b/app/modules/loyalty/templates/loyalty/storefront/enroll-success.html index 85bda89c..28254cf0 100644 --- a/app/modules/loyalty/templates/loyalty/storefront/enroll-success.html +++ b/app/modules/loyalty/templates/loyalty/storefront/enroll-success.html @@ -21,7 +21,10 @@ x-text="enrollContext.already_enrolled ? i18nStrings.already_enrolled_title : i18nStrings.success_title"> {{ _('loyalty.enrollment.success.title') }} -

{{ _('loyalty.enrollment.success.message') }}

+

+ {{ _('loyalty.enrollment.success.message') }} +

@@ -137,7 +140,9 @@ function customerLoyaltyEnrollSuccess() { }, i18nStrings: { success_title: {{ _('loyalty.enrollment.success.title')|tojson }}, + success_message: {{ _('loyalty.enrollment.success.message')|tojson }}, already_enrolled_title: {{ _('loyalty.enrollment.already_enrolled_title')|tojson }}, + already_enrolled_message: {{ _('loyalty.enrollment.already_enrolled_message')|tojson }}, cross_location_message: {{ _('loyalty.enrollment.cross_location_message')|tojson }}, single_location_message: {{ _('loyalty.enrollment.single_location_message')|tojson }}, available_locations: {{ _('loyalty.enrollment.available_locations')|tojson }},