Example #1
0
function wc_crm_actions_customer_detail()
{
    if (isset($_GET['page']) && $_GET['page'] != 'wc_new_customer') {
        return;
    }
    $wc_crm_customer_details = new WC_Crm_Customer_Details(0, 0);
    if (isset($_POST['wc_crm_customer_action'])) {
        if (isset($_POST['customer_user']) && !empty($_POST['customer_user'])) {
            $wc_crm_customer_details->save($_POST['customer_user']);
        }
        if (isset($_POST['order_id']) && !empty($_POST['order_id'])) {
            $wc_crm_customer_details->save($_POST['order_id'], false, true);
        } else {
            $wc_crm_customer_details->create_user();
        }
    }
}