custom-fields

WooCommerce: Dynamic Custom Checkout Fields in admin

流过昼夜 提交于 2020-01-02 12:26:49
问题 I am having issues adding custom checkout fields to the order admin (and maybe emails, i'm not there yet). Coding issues aside, I mostly followed https://www.kathyisawesome.com/woocommerce-customize-checkout-fields/ - here's my code so far: http://pastebin.com/y8LDcDxS I have it adding 'x' amount of $fields['extra_fields'] based on product quantity, assuming one product in the cart. I'm struggling with kia_display_order_data_in_admin() - I keep getting bit by get_country() whatever I do. I've

Replace product “on backorder” to a custom field value in Woocommerce

允我心安 提交于 2019-12-31 02:50:07
问题 Firstly, thanks for viewing this question. I've searched and gone through many similar questions however i've not managed to find a perfect fix. Im setting up a website using wordpress/woocommerce, however most of our products have a set lead time therefore everything is on "back order - allow" status. Instead of showing "on backorder" on each product page, I wanted to see if it was possible to create a custom field in each product and replace the "on backorder" text to show that custom field

Getresponse API 2 (Adding Custom fields and contacts using PHP)

限于喜欢 提交于 2019-12-30 05:27:04
问题 Im new to coding and web development as it is and diving into the deep end with API's is a thing i wish i never had done! However being said i have progressed further than expected. I am now having problems when trying to add custom fields to the add contact feature. Im trying to get the code to add the hidden form input fields when the user hits my thankyou page. I dont want to use Getresponses own Form builder for my main page so it was better to use the API. I have the code running

How to save WooCommerce checkout custom fields to user meta

自古美人都是妖i 提交于 2019-12-30 03:34:12
问题 I've created the following custom fields for the user meta using the PODS.io Wordpress plugin: date_of_birth emergency_contact_name relation emergency_phone I've added these fields to the WooCommerce checkout, under extra information, by using the following code in my theme's functions.php : add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' ); function my_custom_checkout_field( $checkout ) { woocommerce_form_field( 'date_of_birth', array( 'type' => 'text', 'class' =>

Add custom columns to admin products list in WooCommerce 3

不打扰是莪最后的温柔 提交于 2019-12-29 07:21:09
问题 Is it possible to add a column "delivery time" to the Woocommerce admin product list? I know there are some additional columns (thumb, price, product_cat etc) to choose at "Screen Options" but "delivery time" is not available. Is it possible somehow to add it to the list? EDIT: I tried to follow LoicTheAztecs answer, but I'm having problems to find the correct meta_key slug. If i search for "delivery" in wp_postmeta I'm getting 0 results. But there are products with delivery time assigned. On

Add custom columns to admin products list in WooCommerce 3

有些话、适合烂在心里 提交于 2019-12-29 07:21:05
问题 Is it possible to add a column "delivery time" to the Woocommerce admin product list? I know there are some additional columns (thumb, price, product_cat etc) to choose at "Screen Options" but "delivery time" is not available. Is it possible somehow to add it to the list? EDIT: I tried to follow LoicTheAztecs answer, but I'm having problems to find the correct meta_key slug. If i search for "delivery" in wp_postmeta I'm getting 0 results. But there are products with delivery time assigned. On

Wordpress - output custom field as ul list

自古美人都是妖i 提交于 2019-12-25 04:55:24
问题 I have a custom field who's content I would like to output as a ul list. The custom field contains words that are separated with spaces. I'm trying to use this code here but it's not working. <?php $list_items = get_post_meta($post->ID, 'idid'); if($list_items){ $list_items = explode(" ", $list_items) { echo '<ul>'; foreach($list_items as $list_item) echo '<li>' . $list_item . '</li>'; echo '</ul>'; } } ?> 回答1: 1- add ; before explode function, and remove accolades. 2- declare a second

ambiguous of the custom_buttonfield

大兔子大兔子 提交于 2019-12-25 04:11:55
问题 This is the original button image. The background of the button was transparent. When apply into apps, the button look like this. Please look at top left the button. The background of the button became gray instead of transparent. Here is the Android version's button. Not only the button but also all same type of buttons which background was transparent. The custom_buttonfield public class Custom_ButtonField extends ButtonField { Bitmap mNormal; Bitmap mFocused; Bitmap mActive; int mWidth;

Include HTML tags in custom fields

戏子无情 提交于 2019-12-24 13:16:12
问题 I have a "currently reading" custom field in my WordPress blog post, and I want to output it wrapped in an HTML tag. What I tried was this hack: echo "<h1>" . $mycustomfieldcontent . "</h1>"; What the client prefers to do is to be able to set the HTML in the actual custom field . What would be the proper way to do that? 回答1: You're close. Pretty much the same as your previous question, see the screenshots: Add your Custom Field with HTML in it. Then display it with this: <?php echo get_post

Customizing liferay hook custom fields

帅比萌擦擦* 提交于 2019-12-24 12:27:43
问题 I need to add a Custom Field to Site create page, i went to Portal > Custom Fields > Site and added a custom field named " licence ". I followed this tutorial http://www.liferay.com/pt/community/wiki/-/wiki/Main/Custom+Fields+and+JSP+Hooks I'm trying to access this field in details.jsp page. It's located at of tomcat-7.0.27\webapps\ROOT\html\portlet\sites_admin\site i tryed to do this: <liferay-ui:custom-attribute label="Licence" className="<%= Site.class.getName() %>" classPK="<%= 0 %>"