This file contains hidden or 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
function dokan_can_edit_product_shipping_filed_validation( $errors ) { | |
if ( stripslashes( isset( $_POST['_disable_shipping'] ) ) && 'yes' == $_POST['_disable_shipping'] ) { | |
$errors[] = __( 'Please select shipping option', 'dokan-lite' ); | |
} | |
if ( $_POST['product_shipping_class'] < 1 ) { | |
$errors[] = __( 'Please select shipping class', 'dokan-lite' ); | |
} | |
return $errors; | |
} | |
add_filter( 'dokan_can_edit_product', 'dokan_can_edit_product_shipping_filed_validation', 35, 1 ); |
This file contains hidden or 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
/** | |
* Validation add for product cover image | |
* | |
* @param array $errors | |
* @return array $errors | |
*/ | |
function dokan_can_add_product_validation_customized( $errors ) { | |
$postdata = wp_unslash( $_POST ); | |
$featured_image = absint( sanitize_text_field( $postdata['feat_image_id'] ) ); | |
$_regular_price = absint( sanitize_text_field( $postdata['_regular_price'] ) ); |
This file contains hidden or 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 | |
/** | |
* Exclude admin roles from vendor query | |
* | |
* @param $seller_args | |
* @return mixed | |
*/ | |
function exclude_some_sellers_users( $seller_args ) { | |
$seller_args['role__in'] = array( 'seller' ); // add here roles | |
return $seller_args; |
This file contains hidden or 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
/* | |
* Adding extra field on New product popup/without popup form | |
*/ | |
add_action( 'dokan_new_product_after_product_tags','new_product_field',10 ); | |
function new_product_field(){ ?> | |
<div class="dokan-form-group"> |
This file contains hidden or 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
function dokan_custom_seller_registration_required_fields( $required_fields ) { | |
$required_fields['gst_id'] = __( 'Please enter your GST number', 'dokan-custom' ); | |
return $required_fields; | |
}; | |
add_filter( 'dokan_seller_registration_required_fields', 'dokan_custom_seller_registration_required_fields' ); |
This file contains hidden or 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 sold by on single product page made with Elementor | |
* Add the shortcode [dokan_vendor_name] through a short-code widget on single product page | |
*/ | |
add_shortcode( 'dokan_vendor_name', 'dokan_store_name_shortcode' ); | |
function dokan_store_name_shortcode() { | |
$seller = get_post_field( 'post_author' ); | |
$author = get_user_by( 'id', $seller ); | |
$vendor = dokan()->vendor->get( $seller ); |
This file contains hidden or 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 | |
add_action( 'woocommerce_after_my_account', 'dokan_vendor_wholesale_btn' ); | |
function dokan_vendor_wholesale_btn() { | |
$user_id = get_current_user_id(); | |
$user = get_user_by( 'id', $user_id ); | |
$wholesale_customer = metadata_exists( 'user', $user_id, '_is_dokan_wholesale_customer' ); | |
?> | |
<?php if ( $wholesale_customer ): ?> | |
<?php if ( ! $user->has_cap( 'dokan_wholesale_customer' ) ): ?> | |
<li class="dokan-wholesale-migration-wrapper"> |
This file contains hidden or 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 | |
//removeing the menu from settings variable | |
add_filter( 'dokan_get_dashboard_settings_nav', function($settings_sub) { | |
unset ( $settings_sub['store']); | |
return $settings_sub; | |
} , 500); | |
//adding the menu to the $url variable | |
add_filter('dokan_get_dashboard_nav',function($url) { |
This file contains hidden or 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 the placeholder image | |
*/ | |
add_filter('woocommerce_placeholder_img_src', 'custom_woocommerce_placeholder_img_src'); | |
function custom_woocommerce_placeholder_img_src( $src ) { | |
$upload_dir = wp_upload_dir(); | |
$uploads = untrailingslashit( $upload_dir['baseurl'] ); |
This file contains hidden or 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 | |
Just need basic.- only USA | |
Name: | |
State: | |
Occupation: {"data":[{"id":117,"name":"Physician"} | |
Specialties: {"occupation_ids":[117],"id":1144,"name":"Emergency Med-Pediatric"},{"occupation_ids":[519,518,517,516,515,514,512,511,510,509,507,505,504,503,502,501,500,498,497,496,495,118,117],"id":878,"name":"Other"} | |
Must meet Keywords to pass True: Pediatrics, Pediatricians, Pediatric Hospitalist |