Cancelled orders move to Trash automatically in Woocommerce – how to disable?
A clue: backoffice > woocommerce > settings > tab account/confidentiality > at bottom “Retention of personal data” > change date for the cancelled orders
A clue: backoffice > woocommerce > settings > tab account/confidentiality > at bottom “Retention of personal data” > change date for the cancelled orders
there is a simple plugin if you want to use called Woocommerce Extended Coupon Features Free. This is a freemium plugin but adds enough options to be able to do what you want. Link for the plugin https://wordpress.org/plugins/woocommerce-auto-added-coupons/
The root cause to my issue was using the custom post type of “order”. Once I changed that to something more specific things worked fine. A complete guess but I’m wondering if the post type being “order” and the issue being the “order” query argument caused a conflict.
To check product has TAG or not you have to fetch product from order and search in them. //Custom NEW ORDER Email address depending on Product Tag add_filter( ‘woocommerce_email_recipient_new_order’, ‘new_order_conditional_email_recipient’, 10, 2 ); function new_order_conditional_email_recipient( $recipient, $order ) { if ( ! is_a( $order, ‘WC_Order’ ) ) return $recipient; // (Optional) // Get the order … Read more
You can write a get_the_terms filter to change the other the category values are returned, e.g. function sort_the_terms( $terms, $post_id, $taxonomy ) { if ( ‘categories’ === $taxonomy ) { usort( $terms, function( $term1, $term2 ) { // Better sort logic here return $term1->name <=> $term2->name; } ); } return $terms; } add_filter( ‘get_the_terms’, ‘sort_the_terms’, … Read more
Your query args are not quite correct. When you want to order by a custom field, you need to specify a meta_key argument, and set your orderby to the kind of ordering you need. For example: $args = array( ‘tax_query’ => array( array( ‘taxonomy’ => ‘topic’, ‘field’ => ‘slug’, ‘terms’ => ‘movie’, ), ), ‘post_type’ … Read more
To do this you need to use named meta query clauses according to the official developer docs for WP_Query: ‘orderby’ with multiple ‘meta_key’s If you wish to order by two different pieces of postmeta (for example, City first and State second), you need to combine and link your meta query to your orderby array using … Read more
What you’re asking is a generic (My)SQL question, but anyway, as I already said in my comment, if the post title is always in the form of TM.74.G.<number> like TM.74.G.358 and TM.74.G.1000, then you can use the SUBSTRING() function in MySQL/MariaDB to firstly extract the <number> value (e.g. 358) and then sort the posts by … Read more
<?php add_action( ‘init’, ‘wpse31629_init’ ); function wpse31629_init() { add_post_type_support( ‘post’, ‘page-attributes’ ); } Add that to your functions.php or in a plugin file and you’ll get an attributes dialog box with the menu order input.
You have syntax error in query arguments: ‘orderyby’.