Example #1
0
    public function wc_crm_accounts_custom_columns($column, $post_id)
    {
        switch ($column) {
            case 'owner':
                $account_owner = get_post_meta($post_id, '_account_owner', true);
                $user_meta = (object) get_user_meta($account_owner);
                ?>
        <a href="<?php 
                echo admin_url('profile.php');
                ?>
" target="_blank">
          <?php 
                echo $user_meta->first_name[0];
                ?>
 <?php 
                echo $user_meta->last_name[0];
                ?>
        </a>
        <?php 
                break;
            case 'type':
                $options = wc_crm_get_account_types();
                $type = get_post_meta($post_id, '_account_type', true);
                echo isset($options[$type]) ? $options[$type] : '';
                break;
            case 'ownership':
                $options = wc_crm_get_account_ownerships();
                $ownership = get_post_meta($post_id, '_ownership', true);
                echo isset($options[$ownership]) ? $options[$ownership] : '';
                break;
            case 'industry':
                $all_i = wc_crm_get_industries();
                $ind = get_post_meta($post_id, '_industry', true);
                echo isset($all_i[$ind]) ? $all_i[$ind] : '';
                break;
        }
    }
Example #2
0
 /**
  * Init billing and shipping fields we display + save
  */
 public static function init_fields()
 {
     self::$billing_fields = apply_filters('wc_crm_admin_accounts_billing_fields', array('first_name' => array('label' => __('First Name', 'wc_customer_relationship_manager'), 'show' => false), 'last_name' => array('label' => __('Last Name', 'wc_customer_relationship_manager'), 'show' => false), 'company' => array('label' => __('Company', 'wc_customer_relationship_manager'), 'show' => false), 'address_1' => array('label' => __('Address 1', 'wc_customer_relationship_manager'), 'show' => false), 'address_2' => array('label' => __('Address 2', 'wc_customer_relationship_manager'), 'show' => false), 'city' => array('label' => __('City', 'wc_customer_relationship_manager'), 'show' => false), 'postcode' => array('label' => __('Postcode', 'wc_customer_relationship_manager'), 'show' => false), 'country' => array('label' => __('Country', 'wc_customer_relationship_manager'), 'show' => false, 'class' => 'js_field-country select short', 'type' => 'select', 'options' => array('' => __('Select a country&hellip;', 'wc_customer_relationship_manager')) + WC()->countries->get_allowed_countries()), 'state' => array('label' => __('State/County', 'wc_customer_relationship_manager'), 'class' => 'js_field-state select short', 'show' => false)));
     self::$shipping_fields = apply_filters('wc_crm_admin_accounts_shipping_fields', array('first_name' => array('label' => __('First Name', 'wc_customer_relationship_manager'), 'show' => false), 'last_name' => array('label' => __('Last Name', 'wc_customer_relationship_manager'), 'show' => false), 'company' => array('label' => __('Company', 'wc_customer_relationship_manager'), 'show' => false), 'address_1' => array('label' => __('Address 1', 'wc_customer_relationship_manager'), 'show' => false), 'address_2' => array('label' => __('Address 2', 'wc_customer_relationship_manager'), 'show' => false), 'city' => array('label' => __('City', 'wc_customer_relationship_manager'), 'show' => false), 'postcode' => array('label' => __('Postcode', 'wc_customer_relationship_manager'), 'show' => false), 'country' => array('label' => __('Country', 'wc_customer_relationship_manager'), 'show' => false, 'type' => 'select', 'class' => 'js_field-country select short', 'options' => array('' => __('Select a country&hellip;', 'wc_customer_relationship_manager')) + WC()->countries->get_shipping_countries()), 'state' => array('label' => __('State/County', 'wc_customer_relationship_manager'), 'class' => 'js_field-state select short', 'show' => false)));
     self::$general_fields = apply_filters('wc_crm_admin_accounts_general_fields', array('phone' => array('label' => __('Phone', 'wc_customer_relationship_manager'), 'show' => false), 'fax' => array('label' => __('Fax', 'wc_customer_relationship_manager'), 'show' => false), 'website' => array('label' => __('Website', 'wc_customer_relationship_manager'), 'show' => false), 'ticker_symbol' => array('label' => __('Ticker symbol', 'wc_customer_relationship_manager'), 'show' => false), 'account_type' => array('label' => __('Account Type', 'wc_customer_relationship_manager'), 'show' => false, 'type' => 'select', 'class' => 'select form-field-wide', 'options' => wc_crm_get_account_types()), 'ownership' => array('label' => __('Ownership', 'wc_customer_relationship_manager'), 'show' => false, 'type' => 'select', 'class' => 'select', 'options' => wc_crm_get_account_ownerships()), 'industry' => array('label' => __('Industry', 'wc_customer_relationship_manager'), 'show' => false, 'type' => 'select', 'class' => 'wc-enhanced-select', 'custom_attributes' => array('data-allow_clear' => true, 'data-placeholder' => __('Select an Industry', 'wc_customer_relationship_manager')), 'options' => array("" => "") + wc_crm_get_industries()), 'employees' => array('label' => __('Employees', 'wc_customer_relationship_manager'), 'show' => false, 'type' => 'number', 'custom_attributes' => array('step' => 1, 'min' => 0)), 'annual_revenue' => array('label' => __('Annual Revenue', 'wc_customer_relationship_manager'), 'show' => false, 'type' => 'number', 'custom_attributes' => array('step' => '0.01', 'min' => 0)), 'sic_code' => array('label' => __('SIC code', 'wc_customer_relationship_manager'), 'show' => false, 'type' => 'number', 'custom_attributes' => array('step' => '0.01', 'min' => 0))));
 }