0

I have a requirement to show Registration form in two languages parallel, English in the left and Arabic in the right and User can add information in either or both fields and the information is saved against the field,

enter image description here

So if user add information in English or Arabic the other field is not required anymore and the information is saved in both firstname field and firstname_ar fields,

I already have custom fields registration plugin that will allow add extra fields in registration form

Update: Please note that this requirement is for all fields in registration form and I have a plugin that allow user to add product from front end from their profile, I will need to add this feature there too

  • is your requirement only for first name or for all the fields? – Kalyan Chakravarthi V Mar 2 '18 at 8:41
  • fo all the fields sir, I have updated the question – riksof-zeeshan Mar 2 '18 at 8:44
  • If you show all the fields user may fill partially in both the forms which is not right and not meaningful. As @aton1004 suggested. Show any of the form with user choice and allow them to fill either one. – Kalyan Chakravarthi V Mar 2 '18 at 8:50
  • one more question, Arabic form values will be in Arabic, right? how will customers enter in Arabic are you giving them such feature? – Kalyan Chakravarthi V Mar 2 '18 at 9:04
  • yes they can be translated on a go, – riksof-zeeshan Mar 2 '18 at 10:44
0

I think the better approach you follow here is let the customer choose any form they want to fill in, but save that information into only one field. I mean to say there will be only one attribute for firstname not two i.e firstname and firstname_ar.

It doesn't make sense. What you can do is you can create two seperate from which has input field name same and the form submit to same customer controller, just use different label for each form.

<form action"customer-controller-url" class="form-english">
<label>Firstname</label>
<input type="text" name="firstname" />
</form>

<form action"customer-controller-url" class="form-arabic">
<label>الاسم الأول</label>
<input type="text" name="firstname" />
</form>

It would be better if you allow customer to choose between form and then you display the form.

If you have the specific requirement where customer can add both the Arabic as well as english name and other field then you don't have any other option then creating the customer attribute again for all the repeat field. You can see this. Now once the new attributes are created, you can store them both. But you will have to consider its impact on orders and other places.

I suggest you convince your client to follow the first approach.

Hope you got the gist.

Hope it helps. If it does, please don't forget to accept and vote up the answer. It could help others too.

  • Yes I understand your point but this is customer's requirement cant help it – riksof-zeeshan Mar 2 '18 at 8:49
  • @riksof-zeeshan I have updated the answer please check. – aton1004 Mar 2 '18 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.