Hello guys,
The goal we want to achieve is to enable support for user profile pictures inside the WooCommerce My Account page.
We have added a custom tab in the WooCommerce My Account page where we display a picture using our theme Image element. FYI we use the Pro theme from Apex (also known as X-Theme).
When we click on this picture, we have a modal window that opens where we want to display the form for logged in users to change their profile picture. For this, we will use Toolset Forms.
We want to support different profile picture source with the order of priority as following:
=> Gravatar image
=> Default image
=> Custom image
When the user registers and creates an account, if they have a Gravatar this is the picture that should be shown by default.
If no Gravatar image is available, then it should display a default placeholder profile picture.
Finally, if the user uploads a custom image, then it should be the one displayed.
Before we start to talk about the form to upload/edit your profile picture, I want to make sure I have the proper approach to display the profile picture across the site.
Our theme has an "Image" element which I'll use as a reference to copy the HTML.
For the source of the image I can use conditionals to check if there is a custom image set, if not, if there's a Gravatar available and if not then use the default picture URL.
I'm not entirely sure how I would test against Gravatar for the conditionals though, could you help with this?
Also, for the content selection in the View loop, is there an easy way to only select the current user?
...
So let's say we have our View configured and I have created a user custom field "Profile Picture" which is an image.
Now I'm following this guide to create the form users will use to change their profile picture: https://toolset.com/learn/how-to-add-front-end-forms-to-your-website/
I started to create the form but at the "Build Form" step, I can't remove the Username, Password and Nickname fields, which I don't want to use.
Is there a way to create a form for logged-in users only that do not require their username/password/nickname and they can simply upload a picture to update the custom field value?
I just want a simple drag-and-drop modal window that updates the usermeta for the profile picture, if that's possible.
Last question, assuming I'd like user uploads to go on a cloud like Drive or S3 so that our server is not cluttered with everything users are going to upload... Is that doable at all? If not can we select a specific folder on the server for the uploads?
Thank you!