Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter geohi

    (@geohi)

    anything? 🙂

    what do you mean by this? i had the same problem and tried your solution and it still have me that error.

    what do you mean set the same password all the work?

    Thread Starter geohi

    (@geohi)

    Ive been wanting to display the custom fields in the front end table for so long. with some guidance from the developer, and some digging around on my own, i finally got it. here’s the results (youll need to change your ‘type’ to whatever it is in your database)

    function wpsctDisplayCustomFieldsToFrontenda($primkey) {
        global $wpdb;
        // Custom fields
        $table_name44 = $wpdb->prefix . "wpscst_tickets";
        $table_name33 = $wpdb->prefix . "wpstorecart_meta";
    
        $grabrecord= "SELECT * FROM <code>{$table_name33}</code> WHERE <code>foreignkey</code>= '$primkey' AND <code>type</code>= 'wpsct_custom_72'";
        $resultscf = $wpdb->get_results( $grabrecord , ARRAY_A );
    
    return(base64_decode($resultscf[0]['value']));
    }

    then add this in the <TD> you want

    wpsctDisplayCustomFieldsToFrontenda($result['primkey'])

    voila!

    Thread Starter geohi

    (@geohi)

    You’re awesome! So everything else looks correct other than “Statute Expires”?

    I didn’t get an email back from you… Sure you sent it to the right address? I’d be glad to help any way I can, boss!

    Thread Starter geohi

    (@geohi)

    Ok… here’s the whole function

    function wpsctDisplayCustomFieldsToFrontenda($primkey) {
    
        global $wpdb;
    
        // Custom fields
    
        $table_name33 = $wpdb->prefix . "wpstorecart_meta";
    
        $grabrecord = "SELECT * FROM <code>{$table_name33}</code> WHERE <code>type</code>='wpst-requiredinfo' ORDER BY <code>foreignkey</code> ASC;";
    
        $resultscf = $wpdb->get_results( $grabrecord , ARRAY_A );
    
        if(isset($resultscf)) {
    
                foreach ($resultscf as $field) {
    
                    $specific_items = explode("||", $field['value']);
    
                    $res = $wpdb->get_results("SELECT * FROM <code>{$table_name33}</code> WHERE <code>type</code>='wpsct_custom_{$field['primkey']}' AND <code>foreignkey</code>='{$primkey}';", ARRAY_A);
    
                   if(@isset($res[0]['primkey']) && $specific_items[0]=="wpst-requiredinfo") {
        echo strip_tags(base64_decode($res[0]['value']));
    }
                }
    
        }     
    
    }

    and here’s how im trying to display it down below:

    base64_decode($res[0]['value'])

    but im still not getting anything to show. no errors though. which fieldname/value am i supposed to be using from the DB?

    Thread Starter geohi

    (@geohi)

    you’re awesome… im going to give this a shot. one thing, however. the value of the custom field is actually Statute Expires||optional||input (text)

    how should i write that out?

    and im trying to see from the code how it will pull the data from that field knowing all the primkeys and foreignkeys are subsequent?

    Thread Starter geohi

    (@geohi)

    Hmm.. ok. still having some issues. maybe you can help since youre the author 🙂

    Heres our new function:

    function wpsctDisplayCustomFieldsToFrontenda($primkey) {
        global $wpdb;
        // Custom fields
        $table_name33 = $wpdb->prefix . "wpstorecart_meta";
        $grabrecord = "SELECT * FROM <code>{$table_name33}</code> WHERE <code>type</code>='wpst-requiredinfo' ORDER BY <code>foreignkey</code> ASC;";
        $resultscf = $wpdb->get_results( $grabrecord , ARRAY_A );
        if(isset($resultscf)) {
                echo '<table style="width:100%;"><tbody>';
                foreach ($resultscf as $field) {
                    $specific_items = explode("||", $field['value']);
                    $res = $wpdb->get_results("SELECT * FROM <code>{$table_name33}</code> WHERE <code>type</code>='wpsct_custom_{$field['primkey']}' AND <code>foreignkey</code>='{$primkey}';", ARRAY_A);
                    if(@isset($res[0]['primkey'])) {
                        echo '<tr><td><p style="display:inline;color:red;font-weight:700;">'.$specific_items[0].':</p> '.strip_tags(base64_decode($res[0]['value'])).'</td></tr>';
                    }
                }
                echo '</tbody></table>';
        }
    }

    and are using strip_tags(base64_decode($res[0][‘value’])) where want the data to be shown.

    the database field is called “StatuteExpiry”

    any suggestions?

    Thread Starter geohi

    (@geohi)

    ok so i added that function to the .php i want to echo that specific custom field value, but im not quite sure i know what the variable is?? can you help? thanks

    Thread Starter geohi

    (@geohi)

    great ill look into this. thank you!

    Maybe you could add this to a future update? The ability to customize the front end and/or backend table views? 🙂

    also the ability to sort by: date, email, or the custom fields? 🙂

    thanks!

    Thread Starter geohi

    (@geohi)

    @jquindlen

    ok, im not sure exactly how you went from 0 support to 100% support in a matter of a couple weeks – but it’s happened. i know life gets in the way of this minuscule and trivial world we call the internet, but your plugin is single handedly becoming the premier support tickets plugin, and for that i thank you.

    with that, is this new disable notifications feature available now? or 4.8.8?

    Thread Starter geohi

    (@geohi)

    already posted the solution. thanks tho

    @sirkiu

    seems like i may be able to help. i’ve been journeying through this code trying to make ends meet, practically have rewritten the whole thing to make it work.. maybe i can resell my version of it since the developer has died and dropped off the earth…

    anyway, you should be able to comment out these lines to prevent guest_emails from being shown:

    ` // Guest additions here
    if (is_user_logged_in()) {
    $wpscst_userid = $current_user->ID;
    $wpscst_email = $current_user->user_email;
    $wpscst_username = $current_user->display_name;
    } else {
    $wpscst_userid = 0;
    $wpscst_email = esc_sql($_SESSION[‘wpsct_email’]);
    $wpscst_username = __(‘Guest’, ‘wpsc-support-tickets’) . ‘ (‘ . $wpscst_email . ‘)’; ‘

    Thread Starter geohi

    (@geohi)

    Thanks for the reply. I’m astonished you believe the code is “clean and easy to read” I haven’t seen a single commented line, and the breaks and tabs are.. random at best.

    To get back to you – I am talking about the front end where the users see the table of their currently open/closed tickets.

    Here’s the thing. In the backend options, admins have the options of setting up departments.. (remember the double pipes? ||)

    I have already created the column for Departments – that works, But now i want to populate that column with WHAT the department of that ticket is currently set to.

    So yes – that code i pasted IS the right location of the code. Because if i echo hello or put something random, that table column (in the right spot) does, indeed, populate.

    So, im trying to find the variable or the code to display that ticket’s department. any thoughts?

    [ No bumping please. ]

    Thread Starter geohi

    (@geohi)

    i think you misunderstood what i meant.

    on the table view – when viewing the list of tickets.

    ive already added the field when creating a new ticket.

    i was wondering if there’s a way to add those columns to the list of tickets when viewing them

    Thread Starter geohi

    (@geohi)

    Yep – those are the exact steps i followed.

    I have many, many plugins installed and quite a few use AJAX – at this point there’s no way I could viably disable them one by one to test which it is.

    Bummer :-/

Viewing 15 replies - 1 through 15 (of 22 total)