Using WooCommerce Hooks to add product attribute descriptions to customer order email
Using WooCommerce Hooks to add product attribute descriptions to customer order email
Using WooCommerce Hooks to add product attribute descriptions to customer order email
Admin products page column not sorting
Add a custom field for sorting the products in a specific category WOOCOMMERCE – Second try
Combining search and sort in the admin list using pods
Try this WP_Query arguments: $args = array( ‘post__in’ => $all_ids, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘_event_date’, ‘compare’ => ‘EXISTS’, ), array( ‘key’ => ‘_event_date’, ‘compare’ => ‘NOT EXISTS’, ‘value’ => ‘dummy_value’ // This is just to ensure this condition gets evaluated. ) ), ‘orderby’ => array( ‘meta_value_num’ => ‘DESC’, ‘date’ => … Read more
Use PHP to sort the results after the query (untested): $product_ids = array( 3624, 1298, 430, 5629, 765 ); $query = new WP_Query( array( ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘product_id’, ‘value’ => $product_ids, ‘compare’ => ‘IN’, ), ), ) ); $posts_by_product_id = array(); $sorted_posts = array(); if ( $query->have_posts() ) { … Read more
I don’t think it will be possible using the User Query Class and probably not through MySQL either, because WordPress saves Arrays as Serialized data, so MySQL can’t interpret it like it could if it was a JSON format. The only solution I can foresee is ordering it yourself using a loop in PHP – … Read more
On the template driving your archive page, you can use the query_posts() function to adjust the main query (WordPress’ default main query, not your custom one). query_posts( array( ‘orderby’ => ‘modified’, ‘order’ => ‘ASC’, ) ); Using the pre_get_posts action is the better method, though slightly more complex (untested, would go in theme’s functions.php or … Read more
How to use `$order->get_discount_total()`, avoiding defoult WC decimal rounding?
Critical error on woocommerce checkout page