Tell us what you are trying to do?
When a Woocommerce account is created, a new user (subscriber) is created. We would like to connect that subscriber to other post types. For example, we would like the subscriber to be connected to the customer post type that has their email, address, etc.
Is there any documentation that you are following?
Actually what you can do is to create a profile CPT for your users, then add the appropriate fields to this CPT.
When the user creates their account you can then redirect them to a page that would have the frontend form that will allow them to create their profiles.
Doesn't this mean that all the data that they input would then need to be re-input for the Customer Profile CPT? The way it is now, when a new person subscribes to a service plan, they have to input name, address, phone, email, etc. This is needed for Woocommerce. Can we have a one to one relationship from the Woocommerce user to the customer profile that we made in Toolset.
We have a test site set up if you need to look at it to walk me through this.
Thanks Shane!
Given that the user fills out these fields when signing up "name, address, phone, email, etc" they will be stored on the user itself, so you can retrieve it from the user that way.
"Can we have a one to one relationship from the Woocommerce user to the customer profile that we made in Toolset."
A user is related to a post/page by them being the author of the post. So if they created the post then they will be related to it through the author option.
Now on this profile page I would recommend having other additional information that they would not normally fill in when they are creating their user, as this information from their actual user profiles can still be retrieved on the frontend.
We have a Woocommerce site where client subscribes to a maintenance agreement. I can see where their profile info can be populated by the user metadata. The service agreement is to maintain home appliances. So one CPT would be unit specifics (appliances), another CPT would be service history, another might be location specifics. We would like a service technician (not the customer who bought the maintenance subscription) to be able to view all the accounts (including service history etc) of all the customers and their appliances, but each customer should only be able to see their own appliance/location/profile info.
From what you have described it seems like the service tech would have to be logged into that client's account to create a post with service history that stays connected to that client's user account. Is this technician/client scenerio possible and can you give us some guidance on how to go about this?
Ok so how i'm seeing this is that the customer would have to create their profiles on CPT. Its quite possible that we can get their information from the woocommerce fields to autopopulate the profile fields.
Then you can have another CPT called service log where the technician can create a service log. Now the Service log and Profile CPT will be in a Parent/Child relationship. Preferably a One to One relationships so a service log is tied to only one customer.
The technicians will be able to create their service log and add a customer to that service log. You can use our Access plugin to ensure that the users can only see their own profiles.
On the frontend you will need to create a view for them and add it to their profiles so that they can see the service logs that are attached to there profile.
So the ideal thing to do is that allow them to create a profile, that would atleast have the basic information that the technicians would need.
"Its quite possible that we can get their information from the woocommerce fields to autopopulate the profile fields." Can you link me to instructions on how to do this part? Our Woocommerce shop is already built.
Well there isn't an instruction on how to transfer the data but, when you allow the user to create the post on the frontend form for their profiles you will need to edit the form in Expert mode.
The best thing to do is to set the title of the post to the user's name.
So example how you will transfer there name to this field is by doing this.
Where you have the value attribute you will insert [wpv-user field='billing_first_name'] this will enter the value into the post title.
Secondly if you want to copy over the additional billing information such as Company, Address etc you will need to create matching custom fields in types and then populate these like the example above using the value attribute.
To find the correct name of the fields to place in the [wpv-user] shortcode you will need to inspect the field element on a users profile to find the correct field name. See Screenshot
This shows you the correct field name for the zip code field.