0

i need to add field to sign up page or store setting edit page for every new store to choose his parent from exist dokans.

or add custom post type like store as parents so users can register as store. or child of store.

i want to have hypermarket as new post type so every store can register as child of it.

how can i implement. im expert in coding and wordpress plugin. just need notice or best practice methods.

thanks in advanced from your suggestions.

0

open up store-form.php

<div class="dokan-form-group">
    <label class="dokan-w3 dokan-control-label" for="dokan_store_name"><?php esc_html_e('Store Name', 'dokan-lite'); ?></label>

    <div class="dokan-w5 dokan-text-left">
        <input id="dokan_store_name" required value="<?php echo esc_attr($storename); ?>" name="dokan_store_name" placeholder="<?php esc_attr_e('store name', 'dokan-lite'); ?>" class="dokan-form-control" type="text">
    </div>
</div>
<!-- TODO -->
<div class="dokan-form-group">
    <label class="dokan-w3 dokan-control-label" for="dokan_store_parent_name"><?php esc_html_e('Store Parent Name', 'dokan-lite'); ?></label>

    <div class="dokan-w5 dokan-text-left">
        <input id="dokan_store_parent_name" required value="<?php echo esc_attr($storeparentname); ?>" name="dokan_store_parent_name" placeholder="<?php esc_attr_e('store parent name', 'dokan-lite'); ?>" class="dokan-form-control" type="text">
    </div>
</div>

duplicate this field at line 134 in my current version then

add this at line 13

$storeparentname      = isset($profile_info['store_parent_name']) ? 
$profile_info['store_parent_name'] : ''; //

then add this line at 37

$storename    = sanitize_text_field($get_data['dokan_store_name']); // WPCS: CSRF ok, Input var ok.
// TODO
$storeparentname    = sanitize_text_field($get_data['dokan_store_parent_name']); // WPCS: CSRF ok, Input var ok.

then in template-setting.php add thid line at line 626

    update_user_meta($store_id, 'dokan_profile_settings', $dokan_settings);

    update_user_meta($store_id, 'dokan_store_name', $dokan_settings['store_name']);

then add this line into class-registration.php at line 160 after

    update_user_meta( $user_id, 'dokan_store_name', $dokan_settings['store_name'] );
    update_user_meta( $user_id, 'dokan_store_parent_name', $dokan_settings['store_parent_name'] );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.