admin管理员组

文章数量:1394081

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.

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.

Share Improve this question edited Mar 16, 2020 at 17:53 saber tabatabaee yazdi asked Mar 16, 2020 at 12:03 saber tabatabaee yazdisaber tabatabaee yazdi 1931 gold badge5 silver badges13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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'] );

本文标签: custom post typescustomize Dokan multi vendor how can i set every Dokan as child of another dokan