• Resolved flo1982

    (@flo1982)


    Hello,

    I added a custom field to my vendor registration:

    <p class=”form-row form-group form-row-wide”>
    <label for=”area”><?php esc_html_e( ‘area’, ‘dokan-custom-codes’ ); ?><span class=”required”>*</span></label>
    <select name=”area” id=”area”>
    <option value=””>– Choose –</option>
    <option value=”main”>main</option>
    <option value=”sub”>sub</option>
    </select>
    </p>

    It is saved successfully in the backoffice:

    function dokan_custom_new_seller_created( $vendor_id, $dokan_settings ) {
    $post_data = wp_unslash( $_POST );
    $area = $post_data[‘area’];
    update_user_meta( $vendor_id, ‘dokan_area’, $area );}
    add_action( ‘dokan_new_seller_created’, ‘dokan_custom_new_seller_created’, 10, 2 );

    Now I want to show the saved value in the vendor settings and on my webpage. But this does not work:

    <?php do_action( ‘dokan_product_seller_tab_start’, $author, $store_info ); ?>
    <?php if ( !empty( $store_info[‘area’] ) ) { ?>
    <li class=”store-name”>
    <span><?php esc_html_e( ‘Area:’, ‘dokan-lite’ ); ?></span>
    <span class=”details”>
    <?php echo esc_html($store_info[‘area’]) ; ?>
    </span>

    Can you explain me please, why teh value is not shown on the webpage ?
    Does it has to do something with $store-info ?

    Kind regards
    <?php } ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Custom field not showing on webpage’ is closed to new replies.