Good evening everyone,
For my site, I need to have 3 different types of users:
- Customer
- Escort
- Club
and Osclass only allows 2 types with personal or professional.
How can I do ?
Thank you in advance.
Without modifying core, you can use User Custom Fields plugin.
Available for custom Osclass development. www.defected.dev
great thanks a lot.
Now, depending on the type of user, how can I hide certain links when the user is logged in.
Example:
<?php
$field = usercf_user_field('FIELD ID', osc_logged_user_id());
if($field == 'user type 1') {
// do this
} else if($field == 'user type 2') {
// do this
}
Available for custom Osclass development. www.defected.dev
Hello,
But don't work. This my code :
$field = usercf_user_field('1', osc_logged_user_id());
if($field == 'Client') {?>
<a href=""<?php" echo osc_user_alerts_url(); ?>"><?php _e('Alerts', 'gamma'); ?></a>
<a href=""<?php" echo osc_route_url('favorite-lists'); ?>"><?php _e('Favorite items', 'gamma'); ?></a>
}
I don't have error. I just not see the links in the menu.
Thank you for your help !
[member=77]leuname07[/member] I tested this code and it worked fine. Check if you have a space after "Client" in the options list.
Available for custom Osclass development. www.defected.dev
I have a slightly different issue - I want to add some custom fields and on the signup form & account profile form I only want to show some fields to user and other fields to company.
For example, I add field1, field2, field, field4, etc., and I want to show field2 & field4 only to company - on the signup form and account profile (update) form and hide the rest of the fields from company and show only field1 and field3 to user and hide the rest.
I think the hook that displays fields on signup form needs to be disabled first and then on the signup form each individual field needs to be called with a loop, but I think it is more complicated than that. It would be nice if this is possible to do so we can create different signup options for user/company and/or collect different data. Do you have a solution for this? Thanks!
A simple solution would be to use some JS/jQuery to show the fields according to the value of company field.
Just an example code:
$(function() { $('input[name="b_company"]').on('change', function() { if($(this).val() == 1) { // If user selected "Yes" $('.some-css-class').hide(); } else { $('.some-css-class').show(); } }); });
Available for custom Osclass development. www.defected.dev
Thanks for your reply - looks like it is above my pay grade and also when the user is signing up (on the signup form), info is not there in the database yet to know whether the user is a company or not - so during first-time signup the form cannot tell whether the user is a company or not. Am I right? Thanks!
@resta create 2 diffrent signup for user / company
Install the plugin called user custom field,
Create two signup page for user and company
List the field only for company.
Check the employer_green theme for signup demo.
Done
Done
Done
List the field only for company (how? this is the issue I brought up). When the signup page loads it will display all fields (from the user custom fields plugin) on both forms. I want to show only some fields to the user (on the user signup form) and some other fields to the company (on the company signup form) and I want to know how to do that and with what Defected mentioned, I already commented the issue ie. on the first signup b_company (0 or 1) data is not available and until the user signs up for an account. Thanks!
Is the website online? Can I see? U using any hook for signup page?