woocommerce_order_edit_product action code example

Example 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 );

Example 2: woocommerce_default_catalog_orderby desc

/**
 * This code should be added to functions.php of your theme
 **/

add_filter('woocommerce_default_catalog_orderby', 'custom_default_catalog_orderby');

function custom_default_catalog_orderby() {
     return 'date'; // Can also use title and price
}

Tags:

Php Example