• Resolved nijatmursali

    (@nijatmursali)


    Hello,

    I want to get the values when user registers to website. I mean the values like store_name for example. I have tried adding the following mysql to REGISTRATION.PHP in dokan plugin, but it does not help. How can I achieve that?

    INSERT INTO another_table (title) VALUES (${dokan_settings['store_name'});

    I mean when user registers to system with dokan plugin(it goes to user_metadata, but it is not the issue), it takes dokan_settings[‘store_name’] and adds it to database. I want to insert to another database that dokan_settings array when user registers. How can I do that?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter nijatmursali

    (@nijatmursali)

    Anyone?

    Hello @nijatmursali ,

    It looks like the requirement is beyond the scope of this forum. However, to understand the query better, can you please share an example that is working for you? It can be for WordPress’s default information.

    Please share full details so that I can replicate the procedure and help you match it for Dokan.

    Thank you ??

    Thread Starter nijatmursali

    (@nijatmursali)

    I mean with simple sql command something like

    
    sql = "INSERT INTO TABLE(col_1) VALUES("test")" 
    

    it has to insert to table in the database right?

    So I want to do that when user registers to the system it get dokan_settings['store_name'](or something in dokan settings array. So I want to do it like

    
    sql = "INSERT INTO TABLE(col_1) VALUES(dokan_settings['store_name'])" 
    

    Should not it work as well?

    Thread Starter nijatmursali

    (@nijatmursali)

    For example here. How to access to this panel for getting $dokan_settings array?
    https://ibb.co/RctHVYV

    Hello @nijatmursali ,

    It looks like the approach you have taken to access the vendor’s information will not work.

    Dokan is storing its store/vendor settings that include store URL or store name under dokan_profile_settings meta key. The values are saved in a serialized array so you are unable to access the individual information like the example code you are working with.

    You are supposed to access this information via PHP.

    Thank you ??

    Thread Starter nijatmursali

    (@nijatmursali)

    I have accessed that via PHP, but in WordPress it’s a problem.. This following code gives error, so how can we convert the serialized array into normal one so can use for loop to iterate?

    <?php
    global $wpdb;
    $results = $wpdb->get_results("SELECT meta_value FROM <code>wp_usermeta</code> WHERE meta_key='dokan_profile_settings'", ARRAY_A);
    for($results as $row) {
        echo $row;
    }

    Hello @nijatmursali ,

    You can use PHP’s unserialize function to use that as a normal array.

    Here are two reference –

    1. https://www.php.net/manual/en/function.unserialize.php
    2. https://www.w3schools.com/php/func_var_unserialize.asp

    Thank you ??

    Thread Starter nijatmursali

    (@nijatmursali)

    Yes, but that is not accessible in WordPress. Where can I find this form? It’s for adding new vendor in admin dashboard, but in files where can I find it? https://ibb.co/LnCDFYQ

    Hello @nijatmursali ,

    This part of the plugin is coming from a Vue.js parts of the plugin. Unfortunately, there is no PHP form available on it to add new fields here.

    Thank you ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘getting values from dokan plugin’ is closed to new replies.