custom-fields

Output a custom field value in WooCommerce single product and cart pages

孤人 提交于 2019-11-27 04:53:12
问题 I need help to add the custom data in the front end of the product just like this: This image is a sample if PD # i just add and i want it to add in the front end of the product: Just done adding a the custom field in WooCommerce product pages general setting tab, with the help of: How to add a Custom Fields in Woocommerce 3.1 thanks @Ankur Bhadania. Thanks 回答1: For simple products your product '_pd_number' custom field in simple product pages before add-to-cart, using woocommerce_before_add

WooCommerce : Add custom Metabox to admin order page

我的梦境 提交于 2019-11-27 04:17:01
I am currently successfully adding a field to my WooCommerce product pages which is showing the value: in the cart (front end), on checkout page (front end), on order page (front end), and in admin individual order page (back end). The problem: It isn't showing as a custom field in the admin order "custom fields" Metabox with the value inside it, but just as a text in the order page. Here is my working code: // Add the field to the product add_action('woocommerce_before_add_to_cart_button', 'my_custom_checkout_field'); function my_custom_checkout_field() { echo '<div id="my_custom_checkout

Admin product pages custom field displayed in Cart and checkout

牧云@^-^@ 提交于 2019-11-26 22:04:02
问题 I have created a Custom Field in WooCommerce Admin on the general settings tab of product pages, to insert a some days for manufacture. I would like to show this custom field value on cart and checkout pages above the name of each product. Here is my code: // Insert a Custom Admin Field function woo_add_custom_general_fields() { echo '<div class="options_group">'; woocommerce_wp_text_input( array( 'id' => 'days_manufacture', 'label' => __( 'Days for Manufacture', 'woocommerce' ), 'placeholder

Adding custom field to product category in WooCommerce

我是研究僧i 提交于 2019-11-26 20:54:01
问题 How can I add custom fields to product category? I have added custom field to product but I cant find any extension which provide facility to add custom field to product category. Please help 回答1: You can add custom fields to WooCommerce product category by using following action : product_cat_add_form_fields product_cat_edit_form_fields edited_product_cat create_product_cat UPDATED on 17-Feb-2017 For WP version 4.4 and above. As of WordPress 4.4, update_term_meta() and get_term_meta()

WooCommerce - Overriding billing state and post code on existing checkout fields

人走茶凉 提交于 2019-11-26 17:12:04
问题 I can't find the way to ovveride billing state and post code. How can I edit the other parts of existing billing fields like billing state and post code? This is what I have in the functions.php file in my child theme (I have included the code affecting the billing part): <?php function my_custom_checkout_field( $checkout ) { global $wpdb; $check_zone = $wpdb->get_results("select area_name from brick_area where id='".$_SESSION['area']."'",ARRAY_A); if(!empty($check_zone)){ $check_zoneid =

wordpress - make custom field values clickable to retrive them later

天大地大妈咪最大 提交于 2019-11-26 11:40:46
问题 I want to add a custom column to my the all posts page of admin panel in wordpress. The scenario is - every post has a featured image. When I look at the all posts page in admin panel, then I have a custom column namely \'*\' and it has the value * in every row. I want to click the column value for a particular row to make it selected and have a different look (i.e. bold font). Then in the homepage I\'ll try to retrieve the featured image of those posts for which the custom column value has

WooCommerce : Add custom Metabox to admin order page

六眼飞鱼酱① 提交于 2019-11-26 11:07:34
问题 I am currently successfully adding a field to my WooCommerce product pages which is showing the value: in the cart (front end), on checkout page (front end), on order page (front end), and in admin individual order page (back end). The problem: It isn\'t showing as a custom field in the admin order \"custom fields\" Metabox with the value inside it, but just as a text in the order page. Here is my working code: // Add the field to the product add_action(\'woocommerce_before_add_to_cart_button