Set a Custom Email Header (copy)

/* Set a Custom Email Header * * Original doc: https://wpmailsmtp.com/docs/setting-a-custom-email-header/ */ function wpmsmtp_custom_mail_header( $args ) { if ( ! is_array( $args[ ‘headers’ ] ) ) { $args[ ‘headers’ ] = explode( “n”, str_replace( “rn”, “n”, $args[ ‘headers’ ] )…Continue reading

AI Engine – Racovian Framework Integration

add_filter( ‘mwai_chatbot_system_string’, function ( $system_string, $chatbot ) { // Only target your specific Research Forum chatbot if ( $chatbot->get_id() === ‘vq6zg0’ || $chatbot->get_name() === ‘Research Forum’ ) { $racovian_framework = “\n\nHISTORICAL REFERENCE DATA (RACOVIAN CATECHISM 1605):\n” . “When asked about…Continue reading

WP Fusion – Skip Inactive Subscription Field Sync When Active Subscription Exists

add_filter( ‘wpf_woocommerce_subscription_sync_fields’, ‘rd_wpf_skip_inactive_subscription_sync_when_customer_has_active_subscription’, 10, 2 ); function rd_wpf_skip_inactive_subscription_sync_when_customer_has_active_subscription( $update_data, $subscription ) { if ( ! is_object( $subscription ) || ! method_exists( $subscription, ‘get_status’ ) || ! method_exists( $subscription, ‘get_user_id’ ) || ! method_exists( $subscription, ‘get_id’ ) ) { return $update_data;…Continue reading

increase max file size

/* Increase WordPress upload size, post size, and max execution time Original doc link: https://wpforms.com/how-to-change-max-file-upload-size-in-wordpress/ For support, please visit: https://www.facebook.com/groups/wpformsvip */ @ini_set( ‘upload_max_size’ , ‘256M’ ); @ini_set( ‘post_max_size’, ‘256M’); @ini_set( ‘max_execution_time’, ‘300’ );Continue reading

WWQ – Allow quoting out-of-stock products

add_action( ‘woocommerce_single_product_summary’, ‘wwq_show_quote_button_for_out_of_stock’, 31 ); function wwq_show_quote_button_for_out_of_stock() { global $product; if ( ! $product instanceof WC_Product || $product->is_in_stock() ) { return; } if ( ! class_exists( ‘WholesaleQuotes\Classes\Frontend\Buttons’ ) ) { return; } \WholesaleQuotes\Classes\Frontend\Buttons::instance()->show_quote_button_on_product_page(); }Continue reading

WWQ – Hide Add to Quote button from regular customers

add_filter( ‘wws_wq_quote_button_html’, ‘wwq_restrict_quote_button_to_wholesale’ ); add_filter( ‘wws_wq_quote_button_cart_html’, ‘wwq_restrict_quote_button_to_wholesale’ ); add_filter( ‘wws_wq_quote_button_checkout_html’, ‘wwq_restrict_quote_button_to_wholesale’ ); function wwq_restrict_quote_button_to_wholesale( $button_html ) { if ( ! is_user_logged_in() ) { return ”; } $user = wp_get_current_user(); if ( class_exists( ‘WWP_Wholesale_Roles’ ) ) { $wholesale_roles = WWP_Wholesale_Roles::getInstance()->getUserWholesaleRole( $user…Continue reading

Restrict Coupons by Shipping Methods

add_filter( ‘woocommerce_coupon_is_valid’, function( $valid, $coupon, $discount ) { // List the coupon codes to restrict (lowercase) $restricted_coupons = [ ‘your-coupon-code’ ]; if ( ! in_array( strtolower( $coupon->get_code() ), $restricted_coupons, true ) ) { return $valid; } // Allowed shipping method…Continue reading

Custom Restriction: Category-Specific Subtotal

add_filter( ‘woocommerce_coupon_is_valid’, ‘custom_category_subtotal_coupon_gate’, 20, 2 ); function custom_category_subtotal_coupon_gate( $valid, $coupon ) { $target_coupon = ‘your-coupon-code’; // lowercase coupon code $threshold = 5000.00; $category_ids = array( 12, 34 ); // replace with actual product category IDs if ( strtolower( $coupon->get_code() )…Continue reading