Minishop2 and Office: additional fields (gender, building, fullname)

Dear MODX Community,

I some questions about using fields in minishop2 with the Extra «Office».

1. user field «gender»
I added a select field for the gender of a customer. I want to use it for the salutation (Mr. / Ms.).
It works within the Office form chunk (tpl.Office.Profile.form)
<!-- gender: {$gender} -->
    <div class="form-group">
        <label class="col-md-2 control-label" for="gender">Anrede</label>
        <div class="col-md-2">
            <select class="form-control" name="gender" id="gender">
              <option value="0">-- Anrede --</option>
              <option value="2" {if $gender == "2" }selected{/if}>Frau</option>
              <option value="1"{if $gender == "1" }selected{/if}>Herr</option>
    <!-- end gender -->
But on registration (in the chunk «tpl.Office.auth.login» it does not save the gender. How do I activate it?

2. Gender in a order of minishop2
How can I add the field «gender» (see above) in the address fields in a order? Chunk «tpl.msOrder».

3. Email addresses with errors
Sometimes new customers do write their email address with errors. Is there a way to add a second field for the email address where they have to enter the email address again to verify it?

thank you for your help.
Fabian Christen
03 июня 2019, 13:23

Комментарии: 2

Василий Наумкин
03 июня 2019, 14:30
1. Office extra requires only email for registration, all other info you can add after it in the private office. But you can change it by custom system plugin, see an example here.

2. Just as any other field in the form. After it you need to specify new field in the &userFields property of msOrder:
It will bind form field gender to profile of user in MODX.

3. I believe you could manage it with javascript on frontend, or with custom system plugin for msOnBeforeCreateOrder event that will check this new field on backend.
    Fabian Christen
    13 июня 2019, 11:14
    Thank you Vasily,

    All 3 points are solved.
    Point 3: I took the frontend javascript solution.

    All the best
      Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.