Skip to content

Instantly share code, notes, and snippets.

View mahbubme's full-sized avatar
🤞
Focusing

Mahbubur Rahman mahbubme

🤞
Focusing
View GitHub Profile
@mahbubme
mahbubme / seller-registration-form.php
Created March 1, 2016 11:09
Remove first-name and last-name compulsory option from Dokan seller registration form. Plugin File location (templates/global/seller-registration-form.php)
<?php
/**
* Dokan Seller registration form
*
* @since 2.4
*
* @package dokan
*/
?>
@mahbubme
mahbubme / functions.php
Created March 1, 2016 11:15
Remove Dokan seller registration form default validation and add new validation.
// remove the filter
remove_filter( 'woocommerce_process_registration_errors', 'dokan_seller_registration_errors' );
remove_filter( 'registration_errors', 'dokan_seller_registration_errors' );
// New registration form erros handling
function dokan_update_seller_registration_errors( $error ) {
$allowed_roles = apply_filters( 'dokan_register_user_role', array( 'customer', 'seller' ) );
// is the role name allowed or user is trying to manipulate?
if ( isset( $_POST['role'] ) && !in_array( $_POST['role'], $allowed_roles ) ) {
@mahbubme
mahbubme / remove_wc_password_meter.php
Last active October 4, 2016 21:44
Remove WordPress default password strength meter
<?php
function remove_wc_password_meter() {
wp_dequeue_script( 'wc-password-strength-meter' );
}
add_action( 'wp_print_scripts', 'remove_wc_password_meter', 100 );
@mahbubme
mahbubme / dokan-dashboard-responsive.js
Created March 10, 2016 07:44
It will help you to solve the Dokan plugin dashboard related tables responsive issue.
jQuery(function($) {
$(".dokan-dashboard-content .dokan-table").addClass("table");
$( ".dokan-dashboard-content .dokan-table" ).before( "<div class='table-responsive'></div>" );
$( ".dokan-dashboard-content .table-responsive" ).append( $( ".dokan-table" ) );
});
@mahbubme
mahbubme / bulkoptions.js
Created March 10, 2016 18:17
Checked multiple checkbox at a time. ( jQuery dependency )
$(document).ready(function() {
$('#selectAllBoxes').click( function(event) {
if( this.checked ) {
$('.checkBoxes').each(function() {
this.checked = true;
@mahbubme
mahbubme / dokan-translation-file-name.txt
Last active November 30, 2016 10:34
Dokan plugin and add-ons translation files name ( File Location: wp-content->languages->plugins )
1) Dokan Plugin
dokan-fr_FR.po
dokan-fr_FR.mo
2) Dokan Live Search
dokan_ls-fr_FR.mo
dokan_ls-fr_FR.po
3) Dokan Paypal Adaptive
dokan-wc-pap-fr_FR.po
@mahbubme
mahbubme / loading.js
Last active February 6, 2019 18:14
Simple preloader jQuery script and CSS for web page layout.
$(document).ready(function() {
// Preloading
var div_box = "<div id='load-screen'><div id='loading'></div></div>";
$("body").prepend(div_box);
$('#load-screen').delay(700).fadeOut(600, function(){
$(this).remove();
});
@mahbubme
mahbubme / dokan-new-shipping-processing-time.php
Created March 21, 2016 09:39
Increase shipping processing time from seller dashboard for Dokan plugin
<?php
function dokan_new_shipping_processing_times() {
$times = array(
'' => __( 'Ready to ship in...', 'dokan' ),
'1' => __( '1 business day', 'dokan' ),
'2' => __( '1-2 business day', 'dokan' ),
'3' => __( '1-3 business day', 'dokan' ),
'4' => __( '3-5 business day', 'dokan' ),
'5' => __( '1-2 weeks', 'dokan' ),
@mahbubme
mahbubme / include-shop-name.php
Last active January 31, 2019 20:34
Include shop name in WooCommerce new order email ( Dokan Plugin ).
<?php
function order_email_include_shop_name( $order ) {
$seller_id = dokan_get_seller_id_by_order( $order->id );
if ( $seller_id !== 0 ) {
$store_info = dokan_get_store_info( $seller_id );
?>
<table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
<?php
/**
* Add and update custom field through Action Hook in registration form. Paste this code in the functions.php . You should create action hook "wpuf_registration_form_hook" in the registration field.
*
* @param int $form_id
* @param null|int $user_id
* @param array $form_settings
*/
function render_registration_form_hook( $form_id, $user_id, $form_settings ) {