orders

Woocommerce-Get Value of Custom Field in Checkout

核能气质少年 提交于 2019-12-11 16:19:04
问题 I have a nimble question that i am not getting any answer of. I have added a custom field using "Checkout Field Editor" in Woocommerce Checkout fields. The field is given below and seems to be working fine. <input class="input-text " name="wc_order_field_7542" id="wc_order_field_7542" placeholder="Pickup Date" value="" type="text"> However, now I am working on a plugin and want to get value inputted in this specific field and cannot seem to figure out. For the other fields I am simply doing

Shopify API: Get Orders In Shopify by Date

≯℡__Kan透↙ 提交于 2019-12-11 14:51:55
问题 Why fetching Orders from Shopify Store by date and limits always returns the orders of latest date? like: if I make a query for getting 5 orders from 1 august 2012 using this query: /admin/orders.json?status=open&created_at_min=2012-08-01 12:00&limit=5 As I have 5 orders in 20 August 2012 and 5 orders in 31 August 2012 but this will returns 5 orders of latest date (31 August 2012). 回答1: The Shopify API returns orders from Most Recent to Oldest. When you submit your query Shopify will first

Onclick event for to get orders in woocommerce database

一个人想着一个人 提交于 2019-12-11 12:49:49
问题 the onclick event i would need it to appear in this code`to place order information in database. Also how do i display order id as four numbers. this is javascript // Provide values from the current cart order var amount = <?php global $woocommerce; print WC()->cart->total; ?>; var merchantOrderId = '<?php print time(); ?>'; var apiKey = 'm85BXXLpf_icrSvqbElR11xquEgmKZ8wfeRb2ly3-G7pIwCKDuytgplB7AQGi-5t'; renderMMoneyPaymentButton(amount, merchantOrderId, apiKey) 回答1: You can only get the

Exclude one specific payment gateway from auto-restock in WooCommerce

寵の児 提交于 2019-12-11 10:35:27
问题 One of my payment getaway is ipay88 which only reduce stock after payment is cleared. During the time when customer is making the payment, the order is under "pending payment" which the stock does not reduce. However, when customer does not make the payment in time, the order will automatically be marked as "cancelled". As I have integrated with auto-restock plugin, "pending payment" to "cancelled" will increase the stock. I would like to ask how do prevent restock for a specific payment

Automark ONLY Paid orders to “Completed” status in WooCommerce 3+

Deadly 提交于 2019-12-11 09:28:51
问题 I would like to automark just success paid orders to "Completed" status. I have searched a lot on Stack and Google, and found this answer code: WooCommerce: Auto complete paid Orders (depending on Payment methods) But problem is that the code mark all placed orders to "Completed" status not depending if order was success placed or not. What do I need to change in the code to automark ONLY Paid orders to "Completed" status? 回答1: New enhanced and simplified code version replacement (March 2019)

Change default order status for COD payment gateway based on user role in Woocommerce

微笑、不失礼 提交于 2019-12-11 08:38:58
问题 In Woocommerce, when the payment option is COD, the orders go directly to the "Processing" state. Source: https://docs.woocommerce.com/document/managing-orders/#prettyPhoto I need this to work like this, except when the client's role is "X". I have seen that this can be solved with this code: function cod_payment_method_order_status_to_onhold( $order_id ) { if ( ! $order_id ) return; $order = wc_get_order( $order_id ); if ( get_post_meta($order->id, '_payment_method', true) == 'cod' ) $order-

Editable admin custom billing fields error issue in Woocommerce 3

心已入冬 提交于 2019-12-11 07:27:21
问题 I have an error located in this code (that adds in order edit pages editable custom billing fields): add_filter( 'woocommerce_admin_billing_fields' , 'order_admin_custom_fields' ); function order_admin_custom_fields( $fields ) { global $theorder; $fields['billing_address_3'] = array( 'label' => __( 'Home', 'woocommerce' ), 'value'=> get_post_meta( $theorder->get_id(), 'Home', true ), 'show' => true, 'wrapper_class' => 'form-field-wide', 'style' => '', ); $fields['billing_address_4'] = array(

Show Shipping Method data on the Order edit pages in WooCommerce

天大地大妈咪最大 提交于 2019-12-11 07:01:50
问题 In WooCommerce on this website, I have 2 Local Pickup shipping methods: AM pickup: shipping_method_0_local_pickup31 PM pickup: shipping_method_0_local_pickup32 Unfortunately this shipping method does not show up on Admin Order edit pages Is is possible to use: add_action('woocommerce_admin_order_data_after_shipping_address','cwn_add_pickup_to_order_item_meta', 1, 2); function cwn_add_pickup_to_order_item_meta($shipping_method) { echo "<h4>Pickup Time</h4>"; echo '<p><strong>' . __('AM pickup'

Change email subject for custom order statuses in Woocommerce 3

試著忘記壹切 提交于 2019-12-11 06:55:09
问题 I have successfully changed email subject for Woocommerce processing order (using this thread) : add_filter( 'woocommerce_email_subject_customer_processing_order', 'email_subject_procs_order', 10, 2 ); function email_subject_procs_order( $formated_subject, $order ){ return sprintf( esc_html__( 'Example of subject #%s', 'textdomain'), $order->get_id() ); } But I want send processing order email again with new subject after order status is changed, so I followed this tread to tweak subject etc.

WooCommerce Access orders that had discounts

懵懂的女人 提交于 2019-12-11 06:49:15
问题 I would like to List all orders that contain products that had discounts on them, so I can generate a report based on only the orders that have discounts on them and get the [ order number, order date, order status, order total, user name, email and phone ] of every order that have product with discount something like if (order_had_product_with_discount) { get the [ order number, order date, order status, order total, user name, email and phone ] of this order } It's not valid code but I need