Hi,
1.- Add this at the very bottom of your theme functions.php:
Notes:
1.- Take care not to leave blank lines after this.
2.- If your theme functions.php doesn't end with ?> skip first line of my code.
<?php function cust_is_profile_complete() {
$mandatory_fields = array(
's_country',
's_region',
's_city',
's_city_area',
's_address',
's_zip',
's_website',
's_phone_land',
's_phone_mobile',
'locale' // (s_info)
);
$profile_complete = 1;
$user_data = User::newInstance()->findByPrimaryKey(osc_logged_user_id());
foreach ($mandatory_fields as $field) {
if (!$user_data[$field]) {
$profile_complete = 0;
break;
}
return $profile_complete;
}
?>
2.- item.php:
<?php if (cust_is_profile_complete()) { ?>
////////////////// ////////////////// ////////////////// ////////////////// ////////////////// //////////////////
////////////////// here the CODE for the contact form that you already have //////////////////
////////////////// ////////////////// ////////////////// ////////////////// ////////////////// //////////////////
<?php } else { ?>
////////////////// ////////////////// ////////////////// ////////////////// ////////////////// ////////////////// ////////////////// //////////////////
<a href="/user/profile" target="_blank" >YOU MUST COMPLETE YOUR PROFILE BEFORE YOU CAN CONTACT SELLERS</a>
////////////////// ////////////////// ////////////////// ////////////////// ////////////////// ////////////////// ////////////////// //////////////////
<?php } ?>
Regards