Skip Navigation

[Resolved] Implement Spinner for Date Picker

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 20 replies, has 2 voices.

Last updated by wilfredC 1 year, 8 months ago.

Assisted by: Waqar.

Author
Posts
#2423583

Yes, you may proceed

#2424683

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the permission.

I'm currently downloading the website's clone using the "Cloudways WordPress Migrator" plugin and will keep you updated with the progress.

#2425701

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for waiting, as I performed some tests on your website's clone.

The user form "Upgrade for VIP membership" on your website is different from a regular form because it is set to add a WooCommerce product to the checkout process as well.

For this particular form, you'll need to make the following changes to make this shadow date picker field work:

In the form's field editor, you'll update the existing shadow field code from:


<input type="text" class="shadow-event-date" name="shadow-event-date" value="[types usermeta='date-of-birth' style='text' format='F j, Y' current_user='true'][/types]">

To:


<input type="text" class="shadow-event-date" name="shadow-event-date" value="[types usermeta='date-of-birth' style='text' format='F j, Y' current_user='true'][/types]" required>
<input type="hidden" class="shadow-user-field" name="shadow-user-field" value="[wpv-user field="ID"]" required>

And in the custom PHP code snippet named "dob", you'll replace the existing code with:


add_action( 'cred_success_redirect', 'custom_shadow_dates_func', 10, 3 );
function custom_shadow_dates_func($url, $post_id, $form_data) {

    if ($form_data['id']==106337) {
        $date = new DateTime($_POST['shadow-event-date']);
        $date_timestamp = $date->getTimestamp();
        update_user_meta($_POST['shadow-user-field'], 'wpcf-date-of-birth', $date_timestamp);
    }
    return $url;
}

Note: I created a test user with the "Customer" user role and logged in as that user to test this and confirm that these changes work.

#2427141
fgn.JPG

I got this after I apply your code, the field is a text input field, I also tried to change the type to date and it unable to update the dob field data.

#2427667

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I don't see the changes that I suggested in my last reply on the staging website, now.

Screenshot from the form field editor:
hidden link

Screenshot from the code snippet editor:
hidden link

Can you please apply those changes again, test the form and if it doesn't work, let me know, keeping the changes intact?

#2429505

My issue is resolved now. Thank you!
Last week we migrate the site to another hosting server. The date choosing option shows the date data much faster.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.