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('init', function(){ | |
dokan_pro()->module->deactivate_modules( | |
[ | |
'booking', | |
'color_scheme_customizer', | |
'elementor', | |
'export_import', | |
'follow_store', |
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_filter( 'woocommerce_sale_flash', function( $string, $post, $product ) { | |
$regular_price = (float) $product->get_regular_price(); | |
$sale_price = (float) $product->get_price(); | |
$discount = round( 100 - ( $sale_price / $regular_price * 100 ), 1 ); | |
return sprintf( '<span class="onsale">%s%%</span>', $discount ); |
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( 'wcmp_checkout_update_order_meta', function( $vendor_order_id, $args ){ | |
$parent_order = wc_get_order( $args['order_id'] ); | |
$child_order = wc_get_order( $vendor_order_id ); | |
foreach( $parent_order->get_meta_data() as $meta ){ | |
$child_order->update_meta_data( $meta->key, $meta->value ); |
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_filter('woocommerce_coupon_is_valid', 'wcbr_coupon_is_valid', 10, 2); | |
function wcbr_coupon_is_valid( $valid, $coupon ) { | |
global $woocommerce; | |
$customer_id = $woocommerce->customer->get_id(); | |
$coupon_author_id = get_post_field( 'post_author', $coupon->get_id() ); | |
if ( $customer_id === $coupon_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
SELECT wp_posts.* FROM wp_posts | |
INNER JOIN wp_users AS users ON users.user_email = 'EMAIL_YOU_WANT' | |
INNER JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id | |
WHERE 1=1 | |
AND wp_postmeta.meta_key = '_customer_user' | |
AND wp_postmeta.meta_value = users.ID | |
AND wp_posts.post_type = 'shop_order' | |
GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC |
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 | |
function wcbr_disable_copy_shipping_from_billing_fields( $default, $input ){ | |
if( 0 === stripos($input, 'shipping_') ){ | |
$default = ''; | |
} | |
return $default; |
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_filter('woocommerce_coupon_is_valid', 'wcbr_coupon_is_valid', 10, 2); | |
function wcbr_coupon_is_valid( $valid, $coupon ) { | |
global $woocommerce; | |
$customer = $woocommerce->customer; | |
if ( wc_get_customer_order_count( $customer->get_id() ) < 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
<?php | |
remove_filter( 'woocommerce_cart_shipping_packages', 'dokan_custom_split_shipping_packages' ); | |
remove_filter( 'woocommerce_shipping_package_name', 'dokan_change_shipping_pack_name' ); | |
remove_action( 'woocommerce_checkout_create_order_shipping_item', 'dokan_add_shipping_pack_meta' ); | |
add_filter( 'woocommerce_shipping_methods', function($methods){ | |
unset( $methods['dokan_vendor_shipping'] ); | |
return $methods; | |
}, 11 ); |
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_filter( 'wp_new_user_notification_email', 'gist_change_new_user_message', 10, 3 ); | |
function gist_change_new_user_message( $wp_new_user_notification_email, $user, $blogname ){ | |
$wp_new_user_notification_email['message'] = "This is the new mail body.\r\n\r\n""; | |
return $wp_new_user_notification_email; |
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_filter( 'woocommerce_billing_fields', function( $fields ){ | |
unset( $fields['billing_sex'] ); | |
return $fields; | |
}); |