custom-fields

Adding a custom email recipient depending on selected custom checkout field value

被刻印的时光 ゝ 提交于 2019-12-08 05:00:22
问题 I need for Woocommerce to send a custom email to different individuals depending on the option selected for Field Checkout (technically, the custom field is the person reporting on the product variant they have purchased, but I was not sure how to customize email receipt based on product variant purchased, so it is as follows). First I established the custom field using the following code /** * Add the field to the checkout */ add_action( 'woocommerce_after_order_notes', 'my_custom_checkout

Capture custom checkout field value in Woocommerce

99封情书 提交于 2019-12-08 03:58:05
问题 Im on woocommerce and are trying by snipets, get the value of all fields to send to adroid app with json. The trouble its, that i cant capture the values of custom fields on check out. I tried by plugin and snippet create the field but, i cant recover the values to send to json the field was created with that snipet add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' ); function my_custom_checkout_field( $checkout ) { echo '<div id="my_custom_checkout_field"><h2>' . __('My

Show custom fields on the order editing page in WooCommerce

旧时模样 提交于 2019-12-07 18:41:16
问题 Based on "Show woocommerce product custom fields under the cart and order item name" answer to one of my previous questions, The code shows custom fields on the product edit page. When these fields are filled in, data is displayed on the product page. Here is the code: // Backend: Display additional product fields add_action('woocommerce_product_options_general_product_data', 'add_fields_to_options_general_product_data'); function add_fields_to_options_general_product_data() { // Custom

Displaying custom product data in Order items view

烂漫一生 提交于 2019-12-07 14:12:07
问题 I have a issue with add to cart. I have a product with different custom conditions to choose. When the customer selects a specific choice. it adds to the cart. When the customer choice another choice and adds. Its shows as a second item in the cart. Which is okay. But after the payment, the order shows the both the custom option under the item 1 and item 2 without the custom data. so I was thinking instead of showing the same product as different items. I want to update the product custom

Display product custom fields as order items in Woocommerce 3

无人久伴 提交于 2019-12-07 11:52:33
问题 In Woocommerce, I use custom fields to calculate the price of a product, based on this code - Set a calculated price for variable products in the WooCommerce. Thanks for the help LoicTheAztec. // Add a custom field before single add to cart add_action( 'woocommerce_before_add_to_cart_button', 'custom_product_price_field', 5 ); function custom_product_price_field(){ echo '<div class="custom-text text"> <h3>Rental</h3> <label>Start Date:</label> <input type="date" name="rental_date" value=""

Send custom notification In Woocommerce edit order pages repetition issue

自闭症网瘾萝莉.ら 提交于 2019-12-07 11:36:25
I created "email notifier for order tracking" plugin for woocommerce. All works fine and when I save tracking number, it sends an email to customer. But when I save another field in order page, it sends email again. How can I fix it? add_action('add_meta_boxes', 'kargo_takip'); function kargo_takip() { add_meta_box('kargo_takip_meta_box', 'Kargo Takip', 'kargo_takip_meta_box_ekle', 'shop_order', 'side', 'high'); } function kargo_takip_meta_box_ekle() { global $post; $meta_field_data = get_post_meta($post->ID, '_kargo_takip', true) ? get_post_meta($post->ID, '_kargo_takip', true) : ''; echo '

Add / Update Custom Fields After Select Pictures in Media Window (Wordpress)

青春壹個敷衍的年華 提交于 2019-12-07 10:29:37
问题 I have a question about wordpress, I just added a button called Add Slider in Add/Edit Post Page. here's my code in my function.php : //Add button to create slider add_action('media_buttons','add_my_media_button',15); function add_my_media_button(){ echo '<a href="#" id="insert-my-media" class="button">Add Slider</a>'; } function include_media_button_js_file(){ wp_enqueue_script('media_button',get_bloginfo('template_directory').'/js/media_button.js',array('jquery'),'1.0',true); } add_action(

Set a calculated price for variable products in the WooCommerce

£可爱£侵袭症+ 提交于 2019-12-07 09:23:24
问题 In Woocommerce, I use custom fields to calculate the price of a product, based on this code - Add custom fields to custom product calculated price in Woocommerce. Thanks for the help LoicTheAztec. // Add a custom field before single add to cart add_action( 'woocommerce_before_add_to_cart_button', 'custom_product_price_field', 5 ); function custom_product_price_field(){ echo '<div class="custom-text text"> <h3>Rental</h3> <label>Start Date:</label> <input type="date" name="rental_date" value="

Woocommerce get Product id using product SKU

杀马特。学长 韩版系。学妹 提交于 2019-12-06 19:50:35
问题 I'm working on a separate templates page, which page gets woocommece product sku using custom field of wordpress post. i need to get product id of that sku for create woocommece object and do further things, here is my code. global $woocommerce; //this return sku (custom field on a wordpress post) $sku=get_field( "product_sku" ); if($sku!=''){ //need to create object, but using sku cannot create a object, $product = new WC_Product($sku); echo $product->get_price_html(); } is there way to get

Disabling Add to Cart Button for Specific WooCommerce Products

核能气质少年 提交于 2019-12-06 14:42:35
I'm trying to disable adding to cart certain products which have the "Call to Order" checkbox ticked (see code below) on the product editor. add_action( 'woocommerce_product_options_general_product_data', 'custom_general_product_data_custom_fields' ); /** * Add `Call to Order` field in the Product data's General tab. */ function custom_general_product_data_custom_fields() { // Checkbox. woocommerce_wp_checkbox( array( 'id' => '_not_ready_to_sell', 'wrapper_class' => 'show_if_simple', 'label' => __( 'Call to Order', 'woocommerce' ), 'description' => __( '', 'woocommerce' ) ) ); } add_action(