orders

Custom order status aren't displayed on the customer my account order history

拈花ヽ惹草 提交于 2019-12-22 10:33:07
问题 In WooCommerce, I have made 2 custom order statuses. The first one is 'shipping status' and the other one is 'approved status'. After I have changed some orders status to these two new statuses (which are shipping or approved ), the customer can't view this orders on his order history page. Here is my code: function register_awaiting_shipment_order_status() { if('product_manager' == $get_roles || 'administrator' == $get_roles){ register_post_status( 'wc-shipping', array( 'label' => 'wc

Dispatch received orders woocommerce to dealers sending email notifications

我与影子孤独终老i 提交于 2019-12-22 09:44:30
问题 I have a list of emails (dealers) and I need when I receive order in wp-admin i open this order and send this order to a dealer (commercial , user...). Every dealer have an email and mark this order in custom field that he have been send to this dealer. In my woocommerce orders page I need to open a order and do something like this: Order 001 --- > send to Email1@exemple.com = Order 001 - Sent to Email1@exemple.com Order 002 ----> send to Email2@exemple.com = Order 002 - Sent to Email2

Automatically change WooCommerce order status after specific time has passed?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 09:14:22
问题 Is there any way to have WooCommerce Automatically change a custom order status to a different custom order status after so much time has passed? Basically, I want all orders that are changed to Order Status "Refund-Submitted" be automatically get changed to "Refund-Expired" after 30 days. I realize these are not normal WooCommerce Order Statuses, I created custom ones. So it might be easier to understand what I want if I'm less specific... I just want to be able to have orders that are

Change Woocommerce Order Status based on Shipping Method

女生的网名这么多〃 提交于 2019-12-22 00:36:02
问题 The idea here is that when an order comes in with an "express delivery" as Shipping Method, the order status is updated to On-Hold. As there I have some different "express delivery" Shipping Method rates I thought that by using stristr() to see if the word 'express' appears anywhere in the formatted shipping method title. But I seem to be missing something as I don't get anything. How can I check if the Order shipping method is an "express delivery" to be able to update the order status? Here

Add columns in admin order list on woocommerce 3.3

大兔子大兔子 提交于 2019-12-22 00:27:50
问题 Related to: Add columns to admin orders list in WooCommerce backend Is it possible to add only one new column in admin Order list instead. For the content of this column my-column1 I will like to have 2 custom fields like: $my_var_one = get_post_meta( $post_id, '_the_meta_key1', true ); $my_var_two = get_post_meta( $post_id, '_the_meta_key2', true ); To finish is it possible to position this new column after the order_number ? Any help is appreciated. 回答1: Updated - It can be done this way: /

Get custom order item metadata in Woocommerce 3

泄露秘密 提交于 2019-12-22 00:19:08
问题 I am using Woocommerce latest version 3.4.2. How can I get some order item metadata and assign them a custom value? I get meta data with a common array $item_product_data_array . I need to get a certain value - (Additional modification for the product). And assign custom sku. Example: I have coffe - sku 1001, in array - key [0] Product coffe have additional modification - sugar (meta data) Need found "Sugar" and assign him custom sku - 50005. [label] => Optionally select [value] => Array ( [0

How to Show SKU with product title in Order received page and Email order

吃可爱长大的小学妹 提交于 2019-12-22 00:13:44
问题 In functions.php add_action( 'woocommerce_add_order_item_meta', 'custom_add_item_sku', 10, 3 ); function custom_add_item_sku( $item_id, $values, $cart_item_key ) { $item_sku = get_post_meta( $values[ 'product_id' ], '_sku', true ); wc_add_order_item_meta( $item_id, 'SKU', $item_sku , false ); } But its showing SKU value below Product title but i want it like this SKU:123sd - Product Name 回答1: Update 2018-04-01 - Changing of hook and Improved code. Use woocommerce_order_item_name filter hook

Woocommerce email notification recipient conditionally based on custom field

有些话、适合烂在心里 提交于 2019-12-21 23:30:03
问题 I have a checkout form with a custom field. I would like to add an extra recipient to an order email based on the value in the custom field. The custom field is currently a drop down menu with only 3 options. Below is the code I was able to piece together with some googling however this does not appear to work. function sv_conditional_email_recipient( $recipient, $order ) { $custom_field = get_post_meta($orderid, 'custom_field', true); if ($custom_field == "Value 1") { $recipient .= ', email1

Add a custom action button in WooCommerce admin order list

久未见 提交于 2019-12-21 21:47:44
问题 I have followed this instructions to add a custom order status for my WooCommerce Orders. I can't find a way to create a custom action button that changes the order status to my custom status from the admin order list page like this screenshot: I would like this custom action button to be shown for the orders that have a "Processing" status. I could not find any answer in WooCommerce documentation. Is there a hook to apply these buttons? How can I add it in the function.php ? Thank you 回答1:

Send a custom reminder email for WooCommerce On-Hold orders after two days

ε祈祈猫儿з 提交于 2019-12-21 21:41:18
问题 My goal is to send an email to the customer containing custom text if the order status is on-hold and if the order creation time is 48 hours or more old. order is 48 hours old or more send email to customer ask customer to pay include a link to the order (to my account payment page) I'm trying to use the code from an answer to one of my previous questions about Automatically cancel order after X days if no payment in WooCommerce. I have lightly changes the code: add_action( 'restrict_manage