|

Woocommerce Widget Featured Product by Category

In Woocommerce > Includes > Widgets > class-wc-widget-products.php Add at line 70: ‘in_cat’ => array( ‘type’ => ‘text’, ‘std’ => __( ‘Category Number’, ‘woocommerce’ ), ‘label’ => __( ‘In Category’, ‘woocommerce’ ) ), Add at line 101: $cat = ! empty( $instance[‘in_cat’] ) ? sanitize_title( $instance[‘in_cat’] ) : $this->settings[‘in_cat’][‘std’]; Add at line 114: array( ‘taxonomy’…

WordPress Disable Password Change Nofitication

There are a few older functions that you would implement via your own custom plugin, but I found that none of them work. This one didn’t work: if ( !function_exists( ‘wp_password_change_notification’ ) ) { function wp_password_change_notification() {} } This one didn’t work: if ( !function_exists(‘wp_new_user_notification’) ) { function wp_new_user_notification( ) {} } This one didn’t…

|

Woocommerce default shipping selection

This function makes Woocommerce automatically select the lowest cost shipping by default function ea_default_shipping_method( $method ) { $_cheapest_cost = 100000; $packages = WC()->shipping()->get_packages()[0][‘rates’]; foreach ( array_keys( $packages ) as $key ) { if ( ( $packages[$key]->cost > 0 ) && ( $packages[$key]->cost < $_cheapest_cost ) ) { $_cheapest_cost = $packages[$key]->cost; $method_id = $packages[$key]->id; } }…