custom-fields

Ruby on Rails - add fields from a Model on another Model's form

核能气质少年 提交于 2019-12-01 09:38:41
I have two models Contract and Addendum . Contract has_many :addendums and Addendum belongs_to :contract When a new Contract is created, automatically will create a new Addendum but some aditional elements are needed to create the new Addendum. How can I add a field value , which is an attribute from Addendum but not from Contract, on the Contract's form? What you're looking for is a nested form , which is pretty common in RoR. For more information on nested and complex forms, there's a section of a Rails Guide for that . I'd recommend checking out all of the Rails Guides , which are

Ruby on Rails - add fields from a Model on another Model's form

删除回忆录丶 提交于 2019-12-01 09:30:48
问题 I have two models Contract and Addendum . Contract has_many :addendums and Addendum belongs_to :contract When a new Contract is created, automatically will create a new Addendum but some aditional elements are needed to create the new Addendum. How can I add a field value , which is an attribute from Addendum but not from Contract, on the Contract's form? 回答1: What you're looking for is a nested form , which is pretty common in RoR. For more information on nested and complex forms, there's a

Save and display product custom data in emails & orders pages in WooCommerce

折月煮酒 提交于 2019-12-01 08:39:21
问题 I'm using some code to add custom fields to enable my customers to customize their products. Here's my current code: /* Add meta fields to all products */ /* SRC: https://wisdmlabs.com/blog/add-custom-data-woocommerce-order-2/ */ /* Step 1: Adding Custom Field for Product */ add_action('woocommerce_before_add_to_cart_button','rs_add_custom_fields'); /** * Adds custom field for Product * @return [type] [description] */ function rs_add_custom_fields() { global $product; ob_start(); ?> <div

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

…衆ロ難τιáo~ 提交于 2019-12-01 01:52:43
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? 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 field when it's checked on the order edit page Here is that code: // Add custom checkout field: woocommerce

Add custom columns to admin products list in WooCommerce 3

僤鯓⒐⒋嵵緔 提交于 2019-12-01 00:39:54
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 my product page there's a text field "Lieferzeit: 1–2 Wochen" (means Delivery time: 1–2 weeks). If I

WooCommerce - Checkout conditional fields for different persons custom status

萝らか妹 提交于 2019-12-01 00:05:18
I need to modify the checkout process for an woocommere website. The process is determinated by the status of the person that could be one of this: - 'legal entity' - 'individual' I need to have a selector 'User status' (or radio buttons) , just after the 'billing_first_name' and 'billing_last_name'. The selector should work this way: If 'legal entity' is selected, it should display 3 fields: 'phone_number' 'email' 'serial_id' If 'individual' is selected, it should display 3 other fields: 'custom_field1' 'custom_field2' 'custom_field3' I tried WooCommerce Checkout Manager and another plugin

WooCommerce - Checkout conditional fields for different persons custom status

与世无争的帅哥 提交于 2019-11-30 18:10:09
问题 I need to modify the checkout process for an woocommere website. The process is determinated by the status of the person that could be one of this: - 'legal entity' - 'individual' I need to have a selector 'User status' (or radio buttons) , just after the 'billing_first_name' and 'billing_last_name'. The selector should work this way: If 'legal entity' is selected, it should display 3 fields: 'phone_number' 'email' 'serial_id' If 'individual' is selected, it should display 3 other fields:

Add a custom field value below product title in WooCommerce archives pages

时光毁灭记忆、已成空白 提交于 2019-11-30 18:01:17
问题 In WooCommerce I would like to add custom text to my products display, that will be grabbed from a custom field in product's edit page. This is how it looks now: You can see the products with their title below: I would like to add a text below every product, marked with blue pen: I have managed to find some custom php code to add custom field in product's page like this: . This is my code: // Display Fields add_action('woocommerce_product_options_general_product_data', 'woocommerce_product

Add custom fields as cart item meta and order item meta in WooCommerce

徘徊边缘 提交于 2019-11-30 16:57:11
This is a plugin on how to add add cart item meta & order item meta for my WooCommerce order. Initially my code below worked well for input type=text. It returns the label for value and the inputed value. On conversion to type=checkbox the code returns label and value="on" for those that are checked. I would like to return the only value names of checked values (ignore the values unchecked). A refactor to help include more checkboxes options would be helpful to reduce written code. My code: <?php global $woocommerce, $product, $post; add_action( 'woocommerce_before_add_to_cart_button', 'add

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

冷暖自知 提交于 2019-11-30 16:29:30
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 perfectly when it comes to just adding the contact however when i add the set_contact_customs the code does