Multiple sorting criteries (order by)

The solution is old as time is. And it was already described earlier. Place in functions.php class iWC_Orderby_Stock_Status { public function __construct() { // Check if WooCommerce is active if (in_array(‘woocommerce/woocommerce.php’, apply_filters(‘active_plugins’, get_option(‘active_plugins’)))) { add_filter(‘posts_clauses’, array($this, ‘order_by_stock_status’), 2000); } } public function order_by_stock_status($posts_clauses) { global $wpdb; // only change query on WooCommerce loops if (is_woocommerce() … Read more

Add button linked to single product page on order detail page

The woocommerce_order_details_after_order_table hook receives the WC_Order object as the $order argument. This means you can get the items from the order with $order->get_items(). That will return an Array of WC_Order_Items. From this you can get the associated product of the first item, which you can use to get its permalink, to which you can append … Read more

Order management including recurring orders on woocommerce

Assuming you are using WooCommerce? Are you using an additional plugin for recurring orders? I am asking because I have a site setup using WooCommerce Subscriptions. It works nicely and I am able to generate reports in the admin. WooCommerce > Reports. There are several Woo default reports I can run but the subscription plugin … Read more

Wp Query sort order from custom MetaBox

With the guidance of @jacobPeattie below is the working example. Once I removed the commas everything was working great. I added number_format to the deal amount to automatically add the commas on the frontend. <?php $transaction = new WP_Query( array( ‘post_type’ => ‘transactions’, ‘paged’ => $paged, ‘posts_per_page’ => 50, ‘orderby’ => array( ‘meta_value_num’ => ‘ASC’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)