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 / billing-address.php
Created November 19, 2017 06:26
Override billing adddress template
<?php
global $current_user;
$address_fields = array();
if ( isset( $_POST['add_line_1'] )
&& isset( $_POST['city'] )
&& isset( $_POST['state'] )
&& isset( $_POST['zip_code'] )
function Stack() {
this.value = [];
}
Stack.prototype.push = function(value) {
return this.value.push(value);
}
Stack.prototype.pop = function() {
return this.value.pop() ? true : false;
@mahbubme
mahbubme / add-new-git-remote
Last active September 29, 2017 11:06
Automated GIT Deployment
root@serveraddress:DirectoryURL/.git
@mahbubme
mahbubme / functions.php
Created September 27, 2017 09:09
Fix Facebook Feed WD plugin conflicting issue with WP User Frontend plugin.
if ( function_exists('ffwd_activate') ) {
remove_filter( 'mce_external_plugins', 'ffwd_register' );
remove_filter( 'mce_buttons', 'ffwd_add_button', 0 );
if ( is_admin() ) {
add_filter( 'mce_external_plugins', 'ffwd_register' );
add_filter( 'mce_buttons', 'ffwd_add_button', 0 );
}
}
@mahbubme
mahbubme / update_sehedule_product_date_meta.php
Created January 11, 2017 09:17
Update date meta for WooCommerce schedule product with WPUF fields
function update_product_schedule_date_meta( $post_id ) {
$dates_from = get_post_meta( $post_id, '_sale_price_dates_from', true );
$dates_to = get_post_meta( $post_id, '_sale_price_dates_to', true );
$dates_from = strtotime($dates_from);
$dates_to = strtotime($dates_to);
update_post_meta( $post_id, '_sale_price_dates_from', $dates_from );
update_post_meta( $post_id, '_sale_price_dates_to', $dates_to );
}
<?php
/*
* Paste this code in the functions.php
*/
add_action( 'woocommerce_after_add_to_cart_button', 'seller_link_in_product_page');
function seller_link_in_product_page() {
<?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 ) {
@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">
@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 / 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();
});