Home Forums Theme Support Dokan Extra field in registration

This topic is: not resolved

This topic contains 5 replies, has 2 voices, and was last updated by  towhid 3 years, 11 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #54373

    Paul
    Member
    Post count: 14

    I am trying to add in an (about us) text area to the settings page and show it on their shop… cannot find a way of doing this.. do you have an idea

    I took the code that you have posted and played with it… the problem I have I think is being able to show it on the store page…. what code do I use there..?

    function endereco( $current_user, $profile_info ) {
    $pv_local_pickup_enabled = isset( $profile_info['pv_local_pickup_enabled'] ) ? esc_attr($profile_info['pv_local_pickup_enabled']) : 'no';
    $profile = isset( $profile_info['profile'] ) ? $profile_info['profile'] : '';
    ?>
    
    <div class="gregcustom dokan-form-group">
    <label class="dokan-w3 dokan-control-label" for="setting_address">
    <?php _e( 'Local Pickup', 'dokan' ); ?>
    </label>
    <div class="dokan-w5">
    <div class="checkbox">
    <label>
    <input name="pv_local_pickup_enabled" type="checkbox" id="pv_local_pickup_enabled" class="<?php echo 'id_' . $store_id; ?>" value="yes" <?php checked( $pv_local_pickup_enabled, 'yes' ); ?>/>
    <?php
    _e('Enable Local Pickup for the shop products', 'dokan');
    ?>
    </label>
    </div>
    </div>
    </div>
    <div class="gregcustom dokan-form-group">
    <label class="dokan-w3 dokan-control-label" for="setting_address"><?php _e( 'Profile', 'dokan' ); ?></label>
    <div class="dokan-w5">
    <input type="text" class="dokan-form-control input-md valid" name="profile" id="reg_profile" value="<?php echo $profile; ?>" />
    </div>
    </div>
    
    <?php
    }
    add_filter( 'dokan_settings_after_banner', 'endereco', 10, 2);
    
    /**
    * Save the extra fields.
    *
    * @param  int  $customer_id Current customer ID.
    *
    * @return void
    */
    function save_extra_endereco_fields( $store_id, $dokan_settings ) {
    
    if (isset($_POST['pv_local_pickup_enabled'])) {
    $dokan_settings['pv_local_pickup_enabled'] = $_POST['pv_local_pickup_enabled'];
    }
    
    if ( isset( $_POST['profile'] ) ) {
    $dokan_settings['profile'] = $_POST['profile'];
    }
    
    update_user_meta( $store_id, 'dokan_profile_settings', $dokan_settings );
    }
    
    add_action( 'dokan_store_profile_saved', 'save_extra_endereco_fields', 10, 2 );
    #54429

    towhid
    Participant
    Post count: 4505

    Hello Paul,

    I have already forwarded this issue to our developer team. Please allow me sometimes. Hope I will come back to you a right solution.

    Thanks

    #54529

    towhid
    Participant
    Post count: 4505

    Hello Paul,

    add_action( 'dokan_store_profile_frame_after', 'show_field_value', 10, 2 );
    
    function show_field_value($store_user, $store_info) {?>
    
    extra field value: <?php echo $store_info['pv_local_pickup_enabled']; ?>
    <?php }

    ——————————————–

    put this code after that code.

    #54674

    Paul
    Member
    Post count: 14

    OK added that and all it gave me was the fact that the box had been ticked..

    so I added the following and it worked!

    add_action( ‘dokan_store_profile_frame_after', ‘show_field_value', 10, 2 );

    function show_field_value($store_user, $store_info) {?>

    Store Profile

    < ?php echo $store_info['profile']; ?>

    #54686

    Paul
    Member
    Post count: 14

    Thanks again for the code… have been playing with it and want to be able to change it to a text area instead of a textbox and it needs a WYSIWYG editor too… how would I add that in?

    #54747

    towhid
    Participant
    Post count: 4505

    Hello Paul,

    To avail this kind of addition you have to customize the plugin. But I am really sorry to say that we do not provide any customization services. If you need this option very urgently you can hire a developer you can do the customization on your own if you know how to programming.

    Thanks

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Extra field in registration’ is closed to new replies.