View WCAdminLastOrderNote
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_action( 'woocommerce_email_order_details', 'las_order_email_order_details', 10, 4 ); | |
function las_order_email_order_details( $order, $sent_to_admin, $plain_text, $email ) { | |
if($sent_to_admin){ | |
$order_statuses = array('wc-on-hold', 'wc-processing', 'wc-completed'); | |
$customer_user_id = get_current_user_id(); | |
$customer_orders = wc_get_orders( array( | |
'meta_key' => '_customer_user', | |
'meta_value' => $customer_user_id, | |
'post_status' => $order_statuses, | |
'numberposts' => -1 |
View disable-woocommerce-blocks-styles-frontend
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
/** | |
* Disable WooCommerce block styles (front-end). | |
*/ | |
function slug_disable_woocommerce_block_styles() { | |
wp_dequeue_style( 'wc-block-style' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'slug_disable_woocommerce_block_styles' ); |
View css-versioning
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
// Version CSS file in a theme | |
// Uses a Unix Timestring to Version your CSS Files | |
wp_enqueue_style( | |
'theme-styles', | |
get_stylesheet_directory_uri() . '/style.css', | |
array(), | |
filemtime( get_stylesheet_directory() . '/style.css' ) | |
); |
View fix-woocommerce-max-variations-frontend
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
/** | |
* Fix for issue where too many variations causes the front end to not pre-load | |
* all variations and rely on AJAX. | |
*/ | |
function custom_wc_ajax_variation_threshold( $qty, $product ) | |
{ | |
return 400; | |
} | |
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 ); |
View woocommerce-add-product-brand
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 Brand for Products. | |
// Only use if you sell one brand of item ie. Your own brand | |
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) { | |
$entity['brand'] = 'My Brand' ; | |
return $entity; | |
}); |
View woocommerce-ninja-product-enquiry-form
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
// Include a Ninja Forms form in a product page. Different forms for simple and variable products. | |
add_filter( 'the_content', 'ninja_product_enquiry_form' ); | |
function ninja_product_enquiry_form( $content ) { | |
if ( class_exists( 'woocommerce' ) && is_product() && is_main_query() ) { | |
global $product; | |
if ( 'simple' == $product->get_type() ) { | |
ob_start(); | |
Ninja_Forms()->display( 3 ); // Equivalent to shortcode: [ninja_form id=3] | |
return $content . ob_get_clean(); | |
} |
View disable-wp-image-scaling
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( 'big_image_size_threshold', '__return_false' ); |
View bypass-woocommerce-logout-confirmation
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 flatsome_bypass_logout_confirmation() { | |
global $wp; | |
if ( isset( $wp->query_vars['customer-logout'] ) ) { | |
wp_redirect( str_replace( '&', '&', wp_logout_url( wc_get_page_permalink( 'myaccount' ) ) ) ); | |
exit; | |
} | |
} | |
add_action( 'template_redirect', 'flatsome_bypass_logout_confirmation' ); |
View disable-wp-lazy-load
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( 'wp_lazy_loading_enabled', '__return_false' ); |