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
/** | |
* 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 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 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 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 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
/*Extra field on the seller settings and show the value on the store banner -Dokan*/ | |
// Add extra field in seller settings | |
add_filter( 'dokan_settings_form_bottom', 'extra_fields', 10, 2); | |
function extra_fields( $current_user, $profile_info ){ | |
$seller_url= isset( $profile_info['seller_url'] ) ? $profile_info['seller_url'] : ''; | |
?> | |
<div class="gregcustom dokan-form-group"> |
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 | |
class Dokan_Setup_Wizard_Override extends Dokan_Seller_Setup_Wizard { | |
/** | |
* Introduction step. | |
*/ | |
public function dokan_setup_introduction() { | |
$dashboard_url = dokan_get_navigation_url(); |
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 | |
/* | |
You can change any field title or remove any feild for the vendor -> settings -> payment -> bank transfer method. Please note that this | |
code need to be placed on your child-theme functions.php file | |
*/ | |
add_filter( 'dokan_withdraw_methods', 'wp1923_change_whithdraw_callback', 12 ); | |
function wp1923_change_whithdraw_callback( $methods ) { |
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_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 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 | |
$userID = 2; | |
$args = array( 'author' => $userID, 'post_type' => 'product', 'posts_per_page' => -1, 'post_status' => array( 'publish', 'pending', 'draft', 'future' ) ); | |
$the_query = new WP_Query( $args ); | |
// The Loop | |
if ( $the_query->have_posts() ) { | |
while ( $the_query->have_posts() ) { | |
$the_query->the_post(); | |
wp_delete_post( get_the_ID(), true ); |
NewerOlder