When a woocommerce order is created the status of the order is “processing”. I need to change the default order-status to “pending”. How can I achieve this? Answer The default order status is set by the payment method or the payment gateway. You could try to use this custom hooked function, but it will not work (as this hook is
Tag: orders
Send an email notification when order status change from pending to cancelled
In previous versions of Woocommerce, an email notification was sent automatically when an order was changed from pending status to cancelled status (In my case, this happens after an allotted time set in the inventory section of the admin). In WooCommerce 3.0.8 they have removed this automation and labelled as a fix: https://github.com/woocommerce/woocommerce/blob/master/CHANGELOG.txt And the pull request is here: https://github.com/woocommerce/woocommerce/pull/15170/files
Custom conditional redirections after WooCommerce checkout payment
I use Lirox One theme on Wordpress with WooCommerce. I want make custom redirections after payment: If a customer buy product ID 333, It will be redirected to product 444 (for example). I have make some custom code but it doesn’t works, I get an error 500 (and debug is empty). What I am doing wrong and how can I
Adding an image near the footer on WooCommerce completed orders email notification
I’m trying this code to insert images just near the footer in WooCommerce completed orders email notification, but unfortunately it doesn’t work! Here’s the code I’m trying: Any Clue please? Thanks Answer You should better use a custom hooked function in woocommerce_email_customer_details action hook for example, this way: You could also use woocommerce_email_footer action hook instead which have only one
Get all Orders IDs from a product ID in Woocommerce
How can I get an array with Order IDs by Product ID? I mean receive all orders where specific product is presented. I know how to do this by MySQL, but is there a way to do this by WP_Query function? Answer Updates: 2017 – SQL query changed to “SELECT DISTINCT” instead of “SELECT” to avoid duplicated Order IDs in
Can not get the product details from order_id on the new order hook function
With WooCommerce, I have the following hook in my function.php after the new order is submitted: The above code is not giving me any output i’e it is not entering inside the foreach loop that’s why var_dump() not giving me any output, but if I mention the order_id specifically like create_job_openings($order_id=517) it works, even I tried echo $order_id before foreach
Woocommerce – Getting the order item price and quantity.
Using Woocommerce 2.6.8 , I can’t get the Order Item Data information as described in the docs and here on SO. All I want is to get the Line Item price and Quantity, which should be as simple as: Looking closer at what gets returned returned This is all using documented Woocommerce methods, why is the information I need stored
Check if user have permission or not to download any file in WooCommerce
I want to check whether any user have permission or not to download any file. I have product id and user id so How I can check? I have explored a lot on google and in woocommerce documentation but didn’t find any solution. Any help? Thanks in advance. Answer 2020 – Code update for WooCommerce 3+ Here is the process
WooCommerce order status change from payment gateway
I have integrated a payment gateway to accept online payments for my store running on woocommerce. Everything works fine but I noticed that woocommerce is changing the order status to wc-processing for all the online paid orders by default. As per my store’s functionality I want all the online paid orders to be in wc-on-hold status initially. Is there any
Add custom field data to WooCommerce order
I have a custom field on my WooCommerce single product. It sends to the cart fine, it displays on checkout fine, it shows in the order in the dashboard fine. What I am now trying to do is set the value as a custom field in the order page so I am able to amend the text when I need