Appointments + Layout design

Hi is it possible to design the layout off appointments page, for example chanege Next Button or put background image, make fonts bigger etc...
thanks

  • Timothy Bowers
    • Chief Pigeon

    Hey there.

    Sure it's possible but it would take some custom development for you. Depending on exactly what you want to achieve and the theme then you might be able to achieve this through just CSS.

    If you could visually show me what you want then I might be able to provide some snippets for you if it's simple CSS.

    Take care.

  • Hakan
    • The Incredible Smush

    Hi,

    As Gravity Forms use classical html form and submit button whereas A+ uses JQuery ajax without html form to submit data, you cannot integrate Gravity Forms inside A+ or the other way around.

    It is possible to add additional fields to confirmation area, though, using app_additional_fields filter.

    You can add required jQuery codes to submit those fields using app_footer_scripts filter hook and save them using app_new_appointment action hook.

    Obviously these will require some custom coding.

    Here is a tested and working sample that adds and saves "Newsletter subscription".

    // Adding a newsletter subscription checkbox to confirmation area
    function add_newsletter_checkbox( $ret ) {
    $add = '<label><span>Get Newsletter</span><input type="checkbox" id="appointments_newsletter" /> </label>';
    return $ret . $add;
    }
    add_filter( 'app_additional_fields', 'add_newsletter_checkbox');
    
    // Modify script to submit the additional field
    function modify_script( $script ) {
    $add = 'var app_newsletter=0;$("#appointments_newsletter").change(function(){if ($("#appointments_newsletter").is(":checked")){app_newsletter=1;}else{app_newsletter=0;}});';
    $script = str_replace( '"post_confirmation",', '"post_confirmation", app_newsletter:app_newsletter,', $script );
    return $add. $script;
    }
    add_filter( 'app_footer_scripts', 'modify_script');
    
    // Do something with submitted additional field, e.g. save it in user meta
    function save_newsletter_selection( $app_id  ) {
    global $current_user;
    if ( isset( $_POST['app_newsletter'] ) )
    update_user_meta( $current_user->ID, 'app_newsletter', $_POST['app_newsletter'] );
    }
    add_action( 'app_new_appointment', 'save_newsletter_selection' );

    Cheers,
    Hakan

  • weezie
    • Flash Drive

    Sorry but I am not great at php coding... this helps but how would I add a text field and any other type of input fields? I need to add quite a few additional information gathering info to my form. I can't seem to get it right!

  • Timothy Bowers
    • Chief Pigeon

    Hey there.

    If this isn't something you're able to follow and code up yourself using the example above, then I'm afraid as it's custom you would need to hire a developer.

    Before seeking a developer you might like to do some more searches for code examples. Hakan is a great developer and around the forum are scattered examples of some of the fantastic work he's done. This is includes custom fields.

    If you use the code examples here to get what you want and have any issues then please feel free to open a new thread. We should be able to give you some pointers then.

    If you still need a developer then you may like to try our jobs board:

    https://premium.wpmudev.org/wpmu-jobs

    Take care.

  • PumpinIron
    • Flash Drive

    Hakan (or anyone else),

    I've got the code working but I don't see anything on the backend with scheduled appointments. For instance, when I click on someone's appointment on the backend to view all the details I don't see anything about them subscribing to the newsletter. Am I missing something by chance?

    I figured this little bit of code would make it show up on the backend under their appointment details...

    // Do something with submitted additional field, e.g. save it in user meta
    function save_newsletter_selection( $app_id  ) {
    global $current_user;
    if ( isset( $_POST['app_newsletter'] ) )
    update_user_meta( $current_user->ID, 'app_newsletter', $_POST['app_newsletter'] );
    }
    add_action( 'app_new_appointment', 'save_newsletter_selection' );
  • Timothy Bowers
    • Chief Pigeon

    Hey Pumpinlron.

    if ( isset( $_POST['app_newsletter'] ) )
    update_user_meta( $current_user->ID, 'app_newsletter', $_POST['app_newsletter'] );
    }

    This part of the code is where it updates in the database, it's adding the information into the user meta. The key is app_newsletter.

    You can retrieve the user meta using the get_user_meta() function:

    http://codex.wordpress.org/Function_Reference/get_user_meta

    You might then like to show it within the plugin or their profile:

    http://stackoverflow.com/a/6144758

    That should hopefully get you both in the right direction. If you're still stuck then it would probably be best to consider hiring a developer to code this up. It wouldn't be a huge job. The guys at Tweaky might even take this sort of thing on:

    https://www.tweaky.com/

    Take care.

  • mrpatulski
    • New Recruit

    @timothy I like the filter solution to create extra fields. thank you.

    Is it possible to filter the existing confirmation fields to change their names or input type? ie 'address' to 'role/title' or 'city' to 'meeting type' with a drop down pick list of 'internal, partner, client'?

  • pxwm
    • WP Core Meltdown

    Hi @mrpatulski

    If I've understood your requirement correctly you can achieve this using the [app_confirmation] shortcode.

    For your examples you would revise the shortcode in your appointment page to:-

    [app_confirmation address="role/title:" city="meeting type:"]

    You can view examples for all the fields in the A+ shortcode page.

    Hope this helps
    Regards
    SteveB

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.