diff --git a/messages/en-GB.json b/messages/en-GB.json index bf13144f..7928a965 100644 --- a/messages/en-GB.json +++ b/messages/en-GB.json @@ -78,6 +78,13 @@ "DELIVERED_TO_BUYER": "Delivered to buyer" } }, + "GAS_SAVER_TYPE": { + "GAS_SAVER_TYPE_LABEL": "Gas-saver", + "GAS_SAVER_TYPE_OPTIONS": { + "ON_GAS_SAVER": "On - one gas fee for 3 days of payments", + "OFF_GAS_SAVER": "Off - payments withing 24 hours, gas fee for each payment" + } + }, "SELLER_TO_BUYER_FULFILLMENT_INSTRUCTIONS_LABEL": "Seller fulfilment instructions to buyer", "SELLER_TO_BUYER_FULFILLMENT_INSTRUCTIONS_PLACEHOLDER": "Collection is from the seller's address. If delivery is selected, please enter the buyer's address.", "BUYER_TO_SELLER_FULFILLMENT_DETAILS_LABEL": "Buyer fulfilment details", diff --git a/messages/en.json b/messages/en.json index d5f4cf1c..9f0a1202 100644 --- a/messages/en.json +++ b/messages/en.json @@ -81,6 +81,13 @@ "SELLER_TO_BUYER_FULFILLMENT_INSTRUCTIONS_LABEL": "Seller fulfillment instructions to buyer", "SELLER_TO_BUYER_FULFILLMENT_INSTRUCTIONS_PLACEHOLDER": "Collection is from the seller's address. If delivery is selected, please enter the buyer's address.", "BUYER_TO_SELLER_FULFILLMENT_DETAILS_LABEL": "Buyer fulfillment details", + "GAS_SAVER_TYPE": { + "GAS_SAVER_TYPE_LABEL": "Gas-saver", + "GAS_SAVER_TYPE_OPTIONS": { + "ON_GAS_SAVER": "On - one gas fee for 3 days of payments", + "OFF_GAS_SAVER": "Off - payments withing 24 hours, gas fee for each payment" + } + }, "VALIDATION": { "EMAIL_VALIDATION": "Please enter a valid email address", "SUCCESSFUL_REGISTRATION_SUBMISSION": "Registration successful", diff --git a/messages/es.json b/messages/es.json index 15c630f7..2355915e 100644 --- a/messages/es.json +++ b/messages/es.json @@ -119,6 +119,13 @@ "VALIDATION": { "REDUCED_DURATION_BELOW_SPENT_WEEKS": "La duración de venta no puede reducirse por debajo de las {spent_weeks} semanas ya transcurridas" } + }, + "GAS_SAVER_TYPE": { + "GAS_SAVER_TYPE_LABEL": "Gas-saver", + "GAS_SAVER_TYPE_OPTIONS": { + "ON_GAS_SAVER": "On - one gas fee for 3 days of payments", + "OFF_GAS_SAVER": "Off - payments withing 24 hours, gas fee for each payment" + } } }, "SELLER_ORDER_FULFILLMENT": { diff --git a/src/app/[locale]/seller/registration/page.tsx b/src/app/[locale]/seller/registration/page.tsx index 1fc78dcf..573a83d0 100644 --- a/src/app/[locale]/seller/registration/page.tsx +++ b/src/app/[locale]/seller/registration/page.tsx @@ -20,7 +20,7 @@ import { ListOrder } from '@/components/shared/Seller/OrderList'; import ToggleCollapse from '@/components/shared/Seller/ToggleCollapse'; import Skeleton from '@/components/skeleton/skeleton'; import { itemData } from '@/constants/demoAPI'; -import { IUserSettings, ISeller, FulfillmentType } from '@/constants/types'; +import { IUserSettings, ISeller, FulfillmentType, GasSaverType } from '@/constants/types'; import { fetchSellerRegistration, registerSeller } from '@/services/sellerApi'; import { fetchUserSettings } from '@/services/userSettingsApi'; import { fetchToggle } from '@/services/toggleApi'; @@ -28,7 +28,8 @@ import { checkAndAutoLoginUser } from '@/utils/auth'; import { translateSellerCategory, getFulfillmentMethodOptions, - getSellerCategoryOptions + getSellerCategoryOptions, + getGasSaverOptions } from '@/utils/translate'; import removeUrls from '../../../../utils/sanitize'; @@ -55,6 +56,7 @@ const SellerRegistrationForm = () => { image: string; fulfillment_method: string; fulfillment_description: string; + gas_saver: string; }; // Initialize state with appropriate types @@ -68,6 +70,7 @@ const SellerRegistrationForm = () => { image: '', fulfillment_method: FulfillmentType.CollectionByBuyer, fulfillment_description: '', + gas_saver: GasSaverType.OnGasSaver }); const [dbSeller, setDbSeller] = useState(null); @@ -148,7 +151,8 @@ const SellerRegistrationForm = () => { phone_number: dbUserSettings?.phone_number || '', image: dbSeller.image || '', fulfillment_method: dbSeller.fulfillment_method || FulfillmentType.CollectionByBuyer, - fulfillment_description: dbSeller.fulfillment_description || '' + fulfillment_description: dbSeller.fulfillment_description || '', + gas_saver: dbSeller.gas_saver? GasSaverType.OnGasSaver: GasSaverType.OffGasSaver || GasSaverType.OnGasSaver }); } else { setFormData({ @@ -160,7 +164,8 @@ const SellerRegistrationForm = () => { phone_number: dbUserSettings?.phone_number || '', image: '', fulfillment_method: FulfillmentType.CollectionByBuyer, - fulfillment_description: '' + fulfillment_description: '', + gas_saver: GasSaverType.OnGasSaver }); } }, [dbSeller, dbUserSettings]); @@ -258,7 +263,8 @@ const SellerRegistrationForm = () => { formDataToSend.append('email', formData.email ?? ''); formDataToSend.append('phone_number', formData.phone_number?.toString() ?? ''); formDataToSend.append('fulfillment_method', formData.fulfillment_method); - formDataToSend.append('fulfillment_description', removeUrls(formData.fulfillment_description)) + formDataToSend.append('fulfillment_description', removeUrls(formData.fulfillment_description)); + formDataToSend.append('gas_saver', formData.gas_saver); // hardcode the value until the form element is built formDataToSend.append('order_online_enabled_pref', 'false'); @@ -583,9 +589,8 @@ const SellerRegistrationForm = () => { value={formData.fulfillment_method} onChange={handleChange} /> -

- {t('SCREEN.SELLER_REGISTRATION.FULFILLMENT_METHOD_TYPE.FULFILLMENT_METHOD_TYPE_LABEL')} -

+ + {/* Seller instruction to buyer field */}