Multiple names per ticket (booking)

WordPress Event Management, Calendars & Registration Forums General Question Multiple names per ticket (booking)

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 5 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32655

    I wanted to implement a booking form where we have multiple names defined per ticket / booking, where the second name is optional, but could not so far accomplish this.

    I exported the form and added an entry thus:

      {
         "label":"Partner / Guest Name",
         "name":"SpouseName",
         "placeholder":"",
         "required":false,
         "parent":9999,
         "label_fname":"First Name",
         "label_lname":"Last Name",
         "lname_required":0,
         "type":"name",
         "field_name":"spousename",
         "position":3,
         "class":"serena-ontario-text-input",
         "id":"spousename"
      },
    

    but the code is somehow still treating the above as mandatory. I looked into the code and it seems to be “hardcoded” to treat the name as mandatory. I tried modifying the code to add a new type called “spousename” (replacing the above “type”: “name” with “type” : “spousename”) but I ran into difficulties trying to do so.

    If there is an easy way to accomplish the above I would love to hear it!

    Thanks
    Colin

    Colin Gajraj
    #32683

    Hi Colin,

    I can’t replicate this unfortunately. On the booking form customer can you confirm that the ‘require second name’ checkbox is unchecked.

    Are you testing this as a logged-in user? And does that user have a surname entered in their profile? There is a known bug where if a logged-in user doesn’t have a surname, the booking will be rejected (if a surname is required on the original name field) but the name field itself is not displayed – because its removed for logged-in users. I’m asking because its possible – if you are logged -in – that the booking is being rejected because of invalid values for the original name field, but that you’re attributing it to your added field as the original name field does not appear.

    Stephen Harris
    #32684

    Hi Stephen

    Yes I confirmed that the ‘require second name’ checkbox is unchecked.

    I am not testing this as a logged-in user.

    If you cannot reproduce this then maybe it’s due to some overridden code that I have? I can try with a fresh install of your plugin to see whether the problem still exists.

    So basically you are able to export the form and add my code above to the JSON, re-import and the second name does NOT show up as mandatory? I am just double checking.

    Thanks
    Colin

    Colin Gajraj
    #32693

    Hi Colin,

    That’s correct. The only change I otherwise had to make was to update the event to use the newly imported booking form.

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.