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 store name on single product*/ | |
add_action( 'woocommerce_single_product_summary', 'seller_name_on_single', 12 ); | |
function seller_name_on_single(){ | |
global $product; | |
$seller = get_post_field( 'post_author', $product->get_id()); | |
$author = get_user_by( 'id', $seller ); | |
$vendor = dokan()->vendor->get( $seller ); | |
$store_info = dokan_get_store_info( $author->ID ); |
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
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 ); | |
function woo_reorder_tabs( $tabs ) { | |
$tabs['reviews']['priority'] = 5; // Reviews first | |
$tabs['description']['priority'] = 10; // Description second | |
$tabs['additional_information']['priority'] = 15; // Additional information third | |
return $tabs; | |
} |
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( 'before_delete_post', function( $id ) { | |
$product = wc_get_product( $id ); | |
if ( ! $product ) { | |
return; | |
} | |
$all_product_ids = []; | |
$product_thum_id_holder = []; | |
$gallery_image_id_holder = []; |
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 | |
/** | |
* Plugin Name: Dokan Vendor Biography Shortcode | |
*/ | |
add_shortcode( 'dokan_vendor_bio', 'dokan_vendor_bio_shortcode' ); | |
function dokan_vendor_bio_shortcode() { | |
$vendor = dokan()->vendor->get( get_query_var( 'author' ) ); | |
$store_info = $vendor->get_shop_info(); | |
if ( empty( $store_info['vendor_biography'] ) ) { | |
return; |
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 |
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 | |
//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 | |
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
/** | |
* 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
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' ); |