Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter keskinn

    (@keskinn)

    Can you help please

    Thread Starter keskinn

    (@keskinn)

    Unfortunately it didn’t work

    Thread Starter keskinn

    (@keskinn)

    I am aware that the plugin is free. But I’m having big problems because I can’t solve the problem. Could you please help me about the wrong coding done by dokan? I’d appreciate it.

    the name of my child theme: woodmart-child

    PHP Page Change :

    <p class="form-row form-group form-row-wide">
        <label for="company-title"><?php esc_html_e( 'Company Title', 'dokan-custom-codes' ); ?><span class="required">*</span></label>
        <input type="text" class="input-text form-control" name="company_title" id="company_title" value="<?php if ( ! empty( $postdata['company_title'] ) ) echo esc_attr($postdata['company_title']); ?>" required="required" />
    </p>

    Funchtions Change :

    add_filter('wp_new_user_notification_email', 'jc_cwue_new_user_notification_email', 10, 3);
    
    function dokan_custom_seller_registration_required_fields( $required_fields ) {
    
        return $required_fields;
    };
    
    add_filter( 'dokan_seller_registration_required_fields', 'dokan_custom_seller_registration_required_fields' );
    
    
    function dokan_custom_new_seller_created( $vendor_id, $dokan_settings ) {
        $post_data = wp_unslash( $_POST );
    
        $company_title =  $post_data['company_title'];
       
        update_user_meta( $vendor_id, 'dokan_custom_company_title', $company_title );
    }
    
    add_action( 'dokan_new_seller_created', 'dokan_custom_new_seller_created', 10, 2 );
    
      /* Add custom profile fields (call in theme : echo $curauth->fieldname;) */ 
    
    add_action( 'dokan_seller_meta_fields', 'my_show_extra_profile_fields' );
    
    function my_show_extra_profile_fields( $user ) { ?>
    
        <?php if ( ! current_user_can( 'manage_woocommerce' ) ) {
                return;
            }
            if ( ! user_can( $user, 'dokandar' ) ) {
                return;
            }
             $gst  = get_user_meta( $user->ID, 'dokan_custom_company_title', true );
         ?>
             <tr>
                        <th><?php esc_html_e( 'Company Title', 'dokan-lite' ); ?></th>
                        <td>
                            <input type="text" name="company_title" class="regular-text" value="<?php echo esc_attr($gst); ?>"/>
                        </td>
             </tr>
        <?php
     }
    
    add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
    add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
    
    function my_save_extra_profile_fields( $user_id ) {
    
    if ( ! current_user_can( 'manage_woocommerce' ) ) {
                return;
            }
        update_usermeta( $user_id, 'dokan_custom_company_title', $_POST['company_title'] );
    }

    Thread Starter keskinn

    (@keskinn)

    Are you saying it will be fixed when I change this code like this?

    <p class="form-row form-group form-row-wide"> <label for="shop-phone"><?php esc_html_e( 'GST Number', 'woodmart-child' ); ?><span class="required">*</span></label> <input type="text" class="input-text form-control" name="gst_id" id="gst_id" value="<?php if ( ! empty( $postdata['gst_id'] ) ) echo esc_attr($postdata['gst_id']); ?>" required="required" /> </p>

    but it still didn’t work

    Thread Starter keskinn

    (@keskinn)

    I don’t understand what you want to say. I will give you all the details step by step.

    I didn’t create my own child theme, I already have one. I use Woodmart and Dokan plugin together. To ignore the dokan templates, I paste it into my child theme and fix it from there. This process is explained in the link I gave above.

    Then I enter loco translate. When I say synchronization in the language file of my plugin, the text field in the code I added does not appear.

    For example, I add a field called company title. However, I cannot translate this field to other languages. Because the company title does not come.

    Thread Starter keskinn

    (@keskinn)

    Everyone does what I’m trying to do. I add a custom text field to the Dokan registration page. Dokan’s guide for this process is in the link. https://wedevs.com/blog/406959/add-extra-fields-to-wordpress-registration-plugin/

    I save the php page in the folder of my child theme. And I am updating this php file. Here I am adding a custom text field. However, when I synchronize this field, unfortunately, this field does not appear.

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