orders

Displaying product custom fields values in the order once processed

為{幸葍}努か 提交于 2019-12-11 02:29:33
问题 On woocommerce, I am using the code below to render some product custom fields, on cart and on checkout: add_filter( 'woocommerce_get_item_data', 'rendering_meta_field_on_cart_and_checkout', 10, 2 ); function rendering_meta_field_on_cart_and_checkout( $cart_data, $cart_item ) { $custom_items = array(); if( !empty( $cart_data ) ) { $custom_items = $cart_data; } if( isset( $cart_item['wccpf_enter_product_id'] ) ) { $diamond = $cart_item['wccpf_enter_product_id']; $pacolor = get_the_terms(

WooCommerce Free Shipping if over 5 pounds

穿精又带淫゛_ 提交于 2019-12-11 01:40:05
问题 I'm trying to write a function that will offer free shipping only (remove all other options) if the order is over 5 pounds (80 ounces), but it doesn't work although the code seems correct. This is what I have: // Hide ALL shipping options but FREe when over 80 ounches (5 pounds) add_filter( 'woocommerce_available_shipping_methods', 'ship_free_if_over_five_pounds' , 10, 1 ); /** * Hide ALL Shipping option but free if over 5 pounds * * @param array $available_methods */ function ship_free_if

Custom editable field in Woocommerce admin edit order pages general section

拜拜、爱过 提交于 2019-12-11 01:13:33
问题 In Woocommerce, the code below retrieves specific custom order item meta data and adds an editable custom field in the admin edit orders pages, under general section area: function editable_order_meta_general( $order_id ){ $order = wc_get_order( $order_id ); // Loop through order items foreach( $order->get_items() as $item_id => $item ){ $yourref = $item->get_meta('Your Reference'); } ?> <br class="clear" /> <h4>Customer Details <a href="#" class="edit_address">Edit</a></h4> <div class=

How to Filter by Order Status

邮差的信 提交于 2019-12-10 12:04:49
问题 I'm on Wordpress using WooCommerce, now a plugin called Parcelware allows me to export any orders between 2 dates, see the code below. I need to add to that a filter that means only 'Processing' orders are exported. Would be great if someone can assist me! I found this link on WooCommerce not sure if it is of any help. http://docs.woothemes.com/document/customer-order-csv-import-suite/#importingorders /** * Read order variables from the database and store them in * their respective variable

Add a button on top of admin orders list in woocommerce

大憨熊 提交于 2019-12-10 11:24:27
问题 I have been struggling to find a hook that allows me to add a button to the top of the woocommerce admin "orders page", but so far unsuccessfully. I have found hooks to add action buttons to the action column, as well as inside each orders page ... but not where I need now. If there is no hook, then an alternative approach. More specifically, I attach an image with the place I am referring to Any suggestions? 回答1: Because this is related to Wordpress and not specific to Woocommerce as Orders

Display orders with a custom status for “all” in Woocommerce admin orders list

孤街醉人 提交于 2019-12-10 10:13:57
问题 I have created few custom order status using this code register_post_status( 'wc-arrival-shipment', array( 'label' => 'Shipped but not paid', 'public' => false, 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, 'label_count' => _n_noop( 'Shipped but not paid<span class="count">(%s)</span>', 'Shipped but not paid <span class="count">(%s)</span>' ) ) ); All is running good except of all orders listing. it shows the correct count all(3) but in

Get WooCommerce orders Items by variation ID

荒凉一梦 提交于 2019-12-10 09:44:52
问题 How can I list order items based on a specific product variations? Given a variation ID , I would like to generate a list of all order items that include that particular variation. In my case I'm using variations to represent dates and the product itself is a recurring event, so the purpose of this is to list the people attending that specific date. It would be amazing if this could be accomplished by something simple like a get_posts using meta_keys or something in that vein, but otherwise I

Add the New order email notification attachment to the vendor email

ⅰ亾dé卋堺 提交于 2019-12-10 09:34:09
问题 In WooCommerce, I use woocommerce-product-vendors as multi vendor plugin. After checkout I receive as admin an a new order email notification with the attachment (uploaded file). But the vendor receive the same email but without the attachment. I need that the vendor receive the attachment too. Thanks 回答1: You could try this code with a custom function hooked in woocommerce_email_recipient_new_order filter hook: add_filter('woocommerce_email_recipient_new_order', 'adding_vendor_email', 10, 2)

Change order status just after payment in WooCommerce [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 02:23:32
问题 This question already has answers here : WooCommerce: Auto complete paid orders (3 answers) Closed 8 months ago . I need to change automatically an order status for completed after receiving payment, but only if the order status is "processing". I found that snippet, what makes orders status completed in every case, but my payments plugins after successful payment changes returns data and changes the order status for "processing". I would like to change it into "completed" after success and

Get the customer ID from an order ID in WooCommerce

蹲街弑〆低调 提交于 2019-12-09 06:35:20
问题 I want to get the "mycred" balance of a customer through the order while using WP ALL Export to export the customer balance based on orders to a spreadsheet. It's actually probably quite simple. I'm able to get the Order ID, but not the Customer ID Here is what I'm doing to test if I can get the customer ID: function get_customeruserid($value) { global $woocommerce, $post; $order = new WC_Order($post->ID); $order_id = $order->get_order_number(); $customer = new WC_Customer($post->ID); $user