This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_ajax_dokan_fetch_product_child_category', 'dokan_fetch_product_child_category' ); | |
function dokan_fetch_product_child_category() { | |
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'marketica-child-theme-nonce' ) ) { | |
wp_send_json_error( __( 'Nonce Verfication faild', 'dokan' ) ); | |
} | |
$category_id = ( isset( $_POST['category'] ) && ! empty( $_POST['category'] ) ) ? $_POST['category'] : ''; | |
if ( empty( $category_id ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
- Missing icon fixing | |
- fontawesome v5 | |
- Use the code from line number 7 to 12 on your child-theme functions.php | |
*/ | |
add_filter ('dokan_get_dashboard_nav','change_icon',16); | |
function change_icon($urls){ | |
$urls['reviews']['icon'] = '<i class="fas fa-comments"></i>'; | |
$urls['reports']['icon'] = '<i class="fas fa-chart-line"></i>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this actions | |
add_action( 'user_new_form', 'add_seller_store_field', 10 ); | |
add_action( 'edit_user_created_user', 'add_shop_url_for_seller' , 10, 2); | |
// Add this filter | |
add_filter( 'user_profile_update_errors', 'check_fields_add_new_user', 10, 3 ); | |
function add_shop_url_for_seller( $user_id, $notify ) { | |
if ( ! $user_id ) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Change store thumb size in store listing page | |
add_filter( 'dokan_store_list_args', 'change_store_list_thumb_size' ); | |
function change_store_list_thumb_size( $args ) { | |
$args['image_size'] = 'full'; | |
return $args; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'dokan_store_list_args', 'change_store_list_thumb_size' ); | |
function change_store_list_thumb_size( $args ) { | |
$args['image_size'] = 'full'; | |
return $args; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First Register the Tab by hooking into the 'woocommerce_product_data_tabs' filter | |
add_filter( 'woocommerce_product_data_tabs', 'add_my_custom_product_data_tab' ); | |
function add_my_custom_product_data_tab( $product_data_tabs ) { | |
$product_data_tabs['my-custom-tab'] = array( | |
'label' => __( 'My Custom Tab', 'my_text_domain' ), | |
'target' => 'my_custom_product_data', | |
); | |
return $product_data_tabs; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('woocommerce_registration_redirect', 'ps_wc_registration_redirect'); | |
function ps_wc_registration_redirect( $redirect_to ) { | |
if ( is_user_logged_in() ){ | |
$current_user = wp_get_current_user(); | |
if( $current_user->roles[0] == 'seller' ) { | |
$redirect_to = dokan_get_navigation_url( 'dashboard' ); | |
return $redirect_to; | |
} | |
} | |
return $redirect_to; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Show Seller name on the product thumbnail | |
For Dokan Multivendor plugin | |
*/ | |
add_action( 'woocommerce_after_shop_loop_item_title','sold_by' ); | |
function sold_by(){ | |
?> | |
</a> | |
<?php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_before_customer_login_form', 'before_login_message' ); | |
function before_login_message() { | |
if ( get_option( 'woocommerce_enable_myaccount_registration' ) == 'yes' ) { | |
?> | |
<div class="woocommerce-info"> | |
<p><?php _e( 'Returning customers login. New users register for next time so you can:' ); ?></p> | |
<ul> | |
<li><?php _e( 'View your order history' ); ?></li> | |
<li><?php _e( 'Check on your orders' ); ?></li> | |
<li><?php _e( 'Edit your addresses' ); ?></li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('woocommerce_registration_redirect', 'ps_wc_registration_redirect'); | |
function ps_wc_registration_redirect( $redirect_to ) { | |
if ( is_user_logged_in() ){ | |
$current_user = wp_get_current_user(); | |
if( $current_user->roles[0] == 'seller' ) { | |
$redirect_to = dokan_get_navigation_url( 'settings/store' ); | |
return $redirect_to; | |
} | |
} | |
return $redirect_to; |