Answers for "woocommerce default order actions"

PHP
1

woocommerce action order complete

function mysite_woocommerce_order_status_completed( $order_id ) {
    error_log( "Order complete for order $order_id", 0 );
}
add_action( 'woocommerce_order_status_completed', 'mysite_woocommerce_order_status_completed', 10, 1 );
Posted by: Guest on August-28-2020
0

change woocommerce default sort order

add_filter('woocommerce_default_catalog_orderby', 'misha_default_catalog_orderby');
 
function misha_default_catalog_orderby( $sort_by ) {
	return 'date';
}
Posted by: Guest on January-28-2021

Browse Popular Code Answers by Language