orders

Replace order status names everywhere incl. Woocommerce admin order preview

时间秒杀一切 提交于 2019-12-08 06:40:24
问题 I need to rename "On Hold" to "Pending Approval" and "Processing" to "Approved", in every instance. (Btw, I'm a diy shop owner, not a developer) This topic got me 60% there, Rename multiple order statuses in Woocommerce Now need to address these locations: admin > orders, the preview popup (eye symbol). front end > my-account/orders, the Status column. front end > my-account/view-order/x, the summary line. My code: add_filter( 'wc_order_statuses', 'rename_order_statuses', 20, 1 ); function

Woocommerce: Display Product Variation Description on order page

你说的曾经没有我的故事 提交于 2019-12-08 06:24:15
问题 I am trying to display the product variation description in the order detail page and in the order email. Following this example Woocommerce: Display Product Variation Description on Cart page it worked perfectly for the cart and also for the checkout. But it seems i can't find the right way of calling it for the order page. This $item = $cart_item['data']; if(!empty($item) && $item->is_type( 'variation' ) ){ echo '<dl><dd>' . $item->get_variation_description() } is not working, as it calls

Custom message on completed order status email notification only for customer user role

梦想与她 提交于 2019-12-08 05:49:01
问题 I would like to improve this code from this answer, to display a message on completed order status emails only for customers, but not for other user roles (as subscribers, etc...). Here is that code: add_action( 'woocommerce_email_before_order_table', 'completed_order_mail_message', 20 ); function completed_order_mail_message( $order ) { if ( empty( $order->get_used_coupons() ) && $order->post_status == 'wc-completed' ) echo '<h2 id="h2thanks">Get 20% off</h2><p id="pthanks">Thank you for

Custom action button in WooCommerce admin orders that send an email

假装没事ソ 提交于 2019-12-08 05:09:57
问题 I added a action button in the order page, the problem is no passing any data to the function. add_filter( 'woocommerce_admin_order_actions', 'add_customer_second_payment_reminder_button', 100, 2 ); function add_customer_second_payment_reminder_button( $actions, $order ) { if ( $order->has_status(array( 'partially-paid' ) )) { $actions['email_reminder'] = array( 'url' => wp_nonce_url( admin_url('admin-ajax.php?action=customer_second_payment_reminder_button&order_id=' . $order->get_id() )),

WooCommerce 3.0+ change admin order date column format

限于喜欢 提交于 2019-12-08 04:16:08
问题 In WooCommerce I was using the code below to alter the admin orders view formatting of the order date column: // Woocommerce show time on order add_filter('post_date_column_time', 'custom_post_date_column_time', 10, 2); function custom_post_date_column_time($h_time, $post) { return get_the_time(__('Y/m/d g:i:s A', 'woocommerce'), $post); } Since WooCommerce 3.0+ it has just stopped working. Any ideas? Thanks 回答1: In WC core code class-wc-admin-post-types.php if you look at render_shop_order

Display Product Brand and Name in Woocommerce Orders and email notifications

☆樱花仙子☆ 提交于 2019-12-08 03:58:11
问题 In WooCommerce I have enabled Perfect Brands Woocommerce plugin to display product Brands. I would like the Brand to appear before the product name throughout the whole cycle (single product page, cart, checkout, mini cart, order and emails). I am able to display the related brand before the product name in cart and checkout pages, using "Adding Woocommerce Brands names to cart item product names" answer code lightly changed (using pbw-brand plugin custom taxonomy) : // Display product brand

Capture custom checkout field value in Woocommerce

99封情书 提交于 2019-12-08 03:58:05
问题 Im on woocommerce and are trying by snipets, get the value of all fields to send to adroid app with json. The trouble its, that i cant capture the values of custom fields on check out. I tried by plugin and snippet create the field but, i cant recover the values to send to json the field was created with that snipet add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' ); function my_custom_checkout_field( $checkout ) { echo '<div id="my_custom_checkout_field"><h2>' . __('My

Add a WooCommerce Orders List Column and value

让人想犯罪 __ 提交于 2019-12-08 03:49:29
In woo commerce order page(Admin Side) I want to add Drop Shipping column in order list which I done through add_filter( 'manage_edit-shop_order_columns', 'custom_shop_order_column', 20 ); function custom_shop_order_column($columns) { $reordered_columns = array(); // Inserting columns to a specific location foreach( $columns as $key => $column){ $reordered_columns[$key] = $column; if( $key == 'order_total' ){ $reordered_columns['drop_shipping'] = __( 'Drop Shipping','twentyseventeen'); } } return $reordered_columns; } It works Now I want to show populate data in that field I found the solution

Send Woocommerce Order to email address listed on product page

家住魔仙堡 提交于 2019-12-08 03:40:29
问题 I'm using Woocommerce and the Product Addons plugin to add extra fields to a product. One of those fields is an email address to let people send the confirmation of the order to a DIFFERENT address than the billing address shown on the checkout page. Emails should be sent to both addresses. Any thoughts on maybe how to modify the functions.php file to do this? 回答1: In the woocommerce_email_recipient_{$this->id} filter hook, you can use the $order argument to get your 2nd email. But first Lets

WooCommerce get order quantity in thank you page and redirect

社会主义新天地 提交于 2019-12-08 03:18:27
What I have done is I redirect the page after purchase but now I want to get the value of ordered quantity so that I can use it to my switch statement for some reason. How can I get the value of ordered quantity of the item? function wc_custom_redirect_after_purchase() { global $wp; if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { //wp_redirect( 'http://grimmindustries.com.au/matchmaker/' ); $quantity = ; // ordered quantity that I need to use to switch statement to redirect switch($quantity) { case 1: wp_redirect( 'http://www.facebook.com/' ); // exampe site break; case