custom-fields

WooCommerce admin order edit save post

十年热恋 提交于 2019-12-21 05:32:37
问题 In WooCommerce, when I submit, how to catch a custom select field added in the order edit admin pages? I have added this custom select field in the file class-wc-meta-box-order-data.php . I get this: But I dont know how to catch or to save $_POST['vendor'] I have tried to add $_POST['vendor'] in wp-admin/post.php , but it doesn't work . This is the code that I have added: <select class="wc-customer-search" id="customer_user" name="customer_user" data-placeholder="<?php esc_attr_e( 'Guest',

Required custom WooCommerce checkout fields don't validate entered value

北城以北 提交于 2019-12-20 04:26:13
问题 I'm adding WooCommerce custom checkout fields in a Storefront child theme functions.php file. They have a "required" attribute. The aim is to have these fields appear at the top of the page, before the billing fields. when clicking the submit button to proceed to payment, I'm getting the required custom field validation error ('please fill in your name') and can't continue with payment, even though filling the field with valid data. Any clue how to fix this or where to start debugging ? here

WooCommerce - Custom notice on Thankyou and “My account” view order pages

柔情痞子 提交于 2019-12-19 11:43:49
问题 On WooCommerce I have a custom field days_manufacture for each product with different (integer) values. Also I Have this code that displays a message on cart page with the highest value of "days of manufacture" : add_action('woocommerce_before_cart', 'days_of_manufacture'); function days_of_manufacture() { $day_txt = ' ' . __('day', 'your_theme_domain_slug' ); $days_txt = ' ' . __('days', 'your_theme_domain_slug' ); $text = __('Your Order will be produced in: ', 'your_theme_domain_slug' );

WooCommerce - Custom notice on Thankyou and “My account” view order pages

北城以北 提交于 2019-12-19 11:43:09
问题 On WooCommerce I have a custom field days_manufacture for each product with different (integer) values. Also I Have this code that displays a message on cart page with the highest value of "days of manufacture" : add_action('woocommerce_before_cart', 'days_of_manufacture'); function days_of_manufacture() { $day_txt = ' ' . __('day', 'your_theme_domain_slug' ); $days_txt = ' ' . __('days', 'your_theme_domain_slug' ); $text = __('Your Order will be produced in: ', 'your_theme_domain_slug' );

Custom fields on java enum not getting serialized

可紊 提交于 2019-12-19 06:39:07
问题 I have a Java Enum as shown below: public enum ExecutionMode { TYPE_A, TYPE_B, TYPE_C; private ExecutionMode(){} //no args constr- no really required private boolean incremental; //has get/set private String someStr; //has get/set } I see that after deserialization, the custom fields on the enum are lost. On reading more about it, I got the impression that enum gets deserialized into a string and hence its custom fields are ignored. If its true, am I abusing Enum here & should just use POJO

Add a custom checkbox in WooCommerce checkout which value shows in admin edit order

拜拜、爱过 提交于 2019-12-19 04:55:36
问题 I try to add an <input type="checkbox"> which value also shows at the woocommerce backend, so I can see at the end if the costumer ticked the box or not. The checkbox should be below the Payment Methods. Is it possible to add a custom checkbox in WooCommerce checkout which value shows in admin edit order? 回答1: You can do it in 3 steps: Adding the custom checkbox field below the Payment Methods Saving the custom checkbox field when it's checked in the order meta Displaying the custom checkbox

Add a product custom field to Admin product bulk edit form in WooCommerce

好久不见. 提交于 2019-12-18 04:26:10
问题 I have added a custom field in my WooCommerce products like in this question/answer: Display a custom product field before short description in WooCommerce. Is it possible to add this custom field to the product bulk edit special page (accessible from Admin products list page) ? 回答1: Yes it's possible to bulk edit products for your custom field '_text_field' (as in your linked question/answer) . You can add this custom field at the beginning or at the end of edit page. For the beginning you

Wordpress: How to ping URL from custom field on publish

不羁的心 提交于 2019-12-13 23:32:54
问题 i have a custom field for source-links. The URL inserted in this custom field should get pinged once the post gets published. I know there is a dedicated trackback field but i want the URL from the custom field automatically added. As far as i understand, $add_ping is exactly that. http://codex.wordpress.org/Function_Reference/add_ping My problem is: i don't know where to add it. I imagine if i'd write this into my theme where i display the source-link, the source gets pinged everytime the

Woocommerce Readonly Billing Fields - Select and Radio Fields

余生颓废 提交于 2019-12-13 20:13:34
问题 I've implemented the solution suggested by @zipkundan like this: add_action('woocommerce_checkout_fields','customization_readonly_billing_fields',10,1); function customization_readonly_billing_fields($checkout_fields){ $current_user = wp_get_current_user();; $user_id = $current_user->ID; foreach ( $checkout_fields['billing'] as $key => $field ){ if($key == 'billing_address_1' || $key == 'billing_address_2' || $key == 'billing_first_name' || $key == 'billing_check_business' || $key == 'billing

AtTask Modifiers

余生长醉 提交于 2019-12-13 04:36:23
问题 I have a few questions on the use of AtTask modifiers. I've been creating an application to pull and push data using the API, and it's been going really well so far -- the documentation is very good and the consistency of the service has been outstanding. I have come up against a few things I wanted to ask about -- it may be that some of these were intentional design choices or limitations, but if not, getting them fixed would lead to drastically fewer API calls (which is a win on both sides)