Jump to content

redirect user to profile edit page if the customfiled not complated


hogava

Recommended Posts

3 hours ago, hogava said:

Hello, 

I added new custom client field, now I need to have everybody complete that field before than order complication.

how can take user to profile edit page if client not completed custom field?

thanks

 

this hook worked for me:

<?php
use WHMCS\Database\Capsule;
add_hook('ClientAreaPageCart', 1, function($vars) {
    $clientsdetails = $vars['clientsdetails'];
    $userid = $clientsdetails['userid'];
    $cxid = Capsule::table('tblcustomfieldsvalues')->where('fieldid','343')->where('relid',$userid)->value('value'); // 343 is the field that needs to be filled.
    if ($cxid == '') {
          header("Location: clientarea.php?action=details");
         exit;
    }else {}
});
?>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated