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 badges1 Answer
Reset to default 0open 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
版权声明:本文标题:custom post types - customize Dokan multi vendor: how can i set every Dokan as child of another dokan? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744664411a2618441.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论