Title: ideatic's Replies | WordPress.org

---

# ideatic

  [  ](https://wordpress.org/support/users/ideatic/)

 *   [Profile](https://wordpress.org/support/users/ideatic/)
 *   [Topics Started](https://wordpress.org/support/users/ideatic/topics/)
 *   [Replies Created](https://wordpress.org/support/users/ideatic/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/ideatic/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/ideatic/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/ideatic/engagements/)
 *   [Favorites](https://wordpress.org/support/users/ideatic/favorites/)

 Search replies:

## Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Woocommerce Custom Fields For Variation] WordPress 5.6 breaks plugin](https://wordpress.org/support/topic/wordpress-5-6-breaks-plugin/)
 *  [ideatic](https://wordpress.org/support/users/ideatic/)
 * (@ideatic)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/wordpress-5-6-breaks-plugin/#post-14002986)
 * You could update options.js with this code to fix the plugin:
 *     ```
       jQuery(document).ready(function ($) {
           $(this).on('change', '.custom_field, .custom_textarea, input.qty', function () {
               $(this).trigger('show_options_final_total');
           });
   
               $(this).trigger('show_options_final_total');
   
           jQuery(document).on('found_variation', 'form.cart', function (event, variation) {
               var $variation_form = $(this);
   
               var $totals = $variation_form.find('#product-options-var-total');
   
               if ($(variation.price_html).find('.amount:last').size()) {
                   product_price = $(variation.price_html).find('.amount:last').text();
                   product_price = product_price.replace(woocommerce_custom_var_options_params.thousand_separator, '');
                   product_price = product_price.replace(woocommerce_custom_var_options_params.decimal_separator, '.');
                   product_price = product_price.replace(/[^0-9\.]/g, '');
                   product_price = parseFloat(product_price);
   
                   $totals.data('product-price', product_price);
               }
   
               $variation_form.trigger('show_options_final_total');
           });
   
           $(this).on('show_options_final_total', function () {
   
               var option_total = 0;
   
               var product_price = $(this).find('#product-options-var-total').data('product-price');
   
               if (typeof product_price == 'undefined') {
                   var product_price = $('#product-options-var-total').attr('product-price');
               }
   
               product_price = parseFloat(product_price);
   
               var product_total_price = 0;
   
               var final_total = 0;
   
               $('.custom-variation').each(function () {
   
                   var option_price = 0;
   
                   option_price = $(this).attr('data-price');
                   var value_entered = $(this).val();
   
                   if (value_entered != '' || option_price == 0) {
                       option_total = parseFloat(option_total) + parseFloat(option_price);
                   }
   
               });
   
               var qty = $('.qty').val();
   
               if (option_total > 0 && qty > 0) {
   
                   option_total = option_total * qty;
   
                   option_total = option_total.toFixed(2);
   
                   option_total = parseFloat(option_total);
   
                   //console.log( product_price );
   
                   if (product_price) {
   
                       product_total_price = product_price * qty;
   
                       product_total_price = product_total_price.toFixed(2);
   
                       product_total_price = parseFloat(product_total_price);
   
                   }
   
                   final_total = option_total + product_total_price;
   
                   final_total = final_total.toFixed(2);
   
                   html = '';
   
                   if (woocommerce_custom_var_options_params.show_op == 1) {
                       html = html + '<dl class="product-options-price"><dt> ' + woocommerce_custom_var_options_params.op_show + ' </dt><dd><strong><span class="amount">' + woocommerce_custom_var_options_params.currency_symbol + option_total + '</span></strong></dd>';
                   }
   
                   if (final_total) {
   
                       if (woocommerce_custom_var_options_params.show_ft == 1) {
                           html = html + '<dt>' + woocommerce_custom_var_options_params.ft_show + '</dt><dd><strong><span class="amount">' + woocommerce_custom_var_options_params.currency_symbol + final_total + '</span></strong></dd>';
                       }
   
                   }
   
                   html = html + '</dl>';
   
                   $('#product-options-var-total').html(html);
   
               } else {
   
                   $('#product-options-var-total').html('');
               }
   
           });
   
           $(this).find('.variations select').change();
   
       	var variation_id = '';
       	jQuery(document).on('found_variation', 'form.cart', function (event, variation) {
       		main_col();
       	});
       	jQuery('.variations select').on('ready change', function () {
       		jQuery(document).on('found_variation', 'form.cart', function (event, variation) {
       			main_col();
       		});
       		jQuery("body").on('click', '.reset_variations', function () {
       			main_col();
       		});
       	});
   
           function main_col() {
   
               $('#product-options-var-total').html('');
               variation_id = jQuery(".variation_id").val();
   
               // alert(variation_id);
   
               if (variation_id !== '' && variation_id !== undefined && variation_id !== 0) {
                   jQuery('.phoen_minss').each(function () {
                       jQuery(this).find('input').val('');
                       jQuery(this).find('textarea').val('');
   
                       if (jQuery(this).hasClass('phoenwwe_' + variation_id)) {
                           jQuery(this).css('display', 'block');
                       } else {
                           jQuery(this).css('display', 'none');
                       }
                   });
               } else {
                   jQuery('.phoen_minss').each(function () {
                       jQuery(this).find('input').val('');
                       jQuery(this).find('textarea').val('');
   
                       jQuery(this).css('display', 'none');
   
                   });
               }
           }
   
       });
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Woocommerce Custom Fields For Variation] For Everyone Who Has A Broken Plugin](https://wordpress.org/support/topic/for-everyone-who-has-a-broken-plugin/)
 *  [ideatic](https://wordpress.org/support/users/ideatic/)
 * (@ideatic)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/for-everyone-who-has-a-broken-plugin/#post-14002982)
 * To make this plugin work again with WP 5.6, you must update options.js with this
   code:
 *     ```
       jQuery(document).ready(function ($) {
           $(this).on('change', '.custom_field, .custom_textarea, input.qty', function () {
               $(this).trigger('show_options_final_total');
           });
   
               $(this).trigger('show_options_final_total');
   
           jQuery(document).on('found_variation', 'form.cart', function (event, variation) {
               var $variation_form = $(this);
   
               var $totals = $variation_form.find('#product-options-var-total');
   
               if ($(variation.price_html).find('.amount:last').size()) {
                   product_price = $(variation.price_html).find('.amount:last').text();
                   product_price = product_price.replace(woocommerce_custom_var_options_params.thousand_separator, '');
                   product_price = product_price.replace(woocommerce_custom_var_options_params.decimal_separator, '.');
                   product_price = product_price.replace(/[^0-9\.]/g, '');
                   product_price = parseFloat(product_price);
   
                   $totals.data('product-price', product_price);
               }
   
               $variation_form.trigger('show_options_final_total');
           });
   
           $(this).on('show_options_final_total', function () {
   
               var option_total = 0;
   
               var product_price = $(this).find('#product-options-var-total').data('product-price');
   
               if (typeof product_price == 'undefined') {
                   var product_price = $('#product-options-var-total').attr('product-price');
               }
   
               product_price = parseFloat(product_price);
   
               var product_total_price = 0;
   
               var final_total = 0;
   
               $('.custom-variation').each(function () {
   
                   var option_price = 0;
   
                   option_price = $(this).attr('data-price');
                   var value_entered = $(this).val();
   
                   if (value_entered != '' || option_price == 0) {
                       option_total = parseFloat(option_total) + parseFloat(option_price);
                   }
   
               });
   
               var qty = $('.qty').val();
   
               if (option_total > 0 && qty > 0) {
   
                   option_total = option_total * qty;
   
                   option_total = option_total.toFixed(2);
   
                   option_total = parseFloat(option_total);
   
                   //console.log( product_price );
   
                   if (product_price) {
   
                       product_total_price = product_price * qty;
   
                       product_total_price = product_total_price.toFixed(2);
   
                       product_total_price = parseFloat(product_total_price);
   
                   }
   
                   final_total = option_total + product_total_price;
   
                   final_total = final_total.toFixed(2);
   
                   html = '';
   
                   if (woocommerce_custom_var_options_params.show_op == 1) {
                       html = html + '<dl class="product-options-price"><dt> ' + woocommerce_custom_var_options_params.op_show + ' </dt><dd><strong><span class="amount">' + woocommerce_custom_var_options_params.currency_symbol + option_total + '</span></strong></dd>';
                   }
   
                   if (final_total) {
   
                       if (woocommerce_custom_var_options_params.show_ft == 1) {
                           html = html + '<dt>' + woocommerce_custom_var_options_params.ft_show + '</dt><dd><strong><span class="amount">' + woocommerce_custom_var_options_params.currency_symbol + final_total + '</span></strong></dd>';
                       }
   
                   }
   
                   html = html + '</dl>';
   
                   $('#product-options-var-total').html(html);
   
               } else {
   
                   $('#product-options-var-total').html('');
               }
   
           });
   
           $(this).find('.variations select').change();
   
       	var variation_id = '';
       	jQuery(document).on('found_variation', 'form.cart', function (event, variation) {
       		main_col();
       	});
       	jQuery('.variations select').on('ready change', function () {
       		jQuery(document).on('found_variation', 'form.cart', function (event, variation) {
       			main_col();
       		});
       		jQuery("body").on('click', '.reset_variations', function () {
       			main_col();
       		});
       	});
   
           function main_col() {
   
               $('#product-options-var-total').html('');
               variation_id = jQuery(".variation_id").val();
   
               // alert(variation_id);
   
               if (variation_id !== '' && variation_id !== undefined && variation_id !== 0) {
                   jQuery('.phoen_minss').each(function () {
                       jQuery(this).find('input').val('');
                       jQuery(this).find('textarea').val('');
   
                       if (jQuery(this).hasClass('phoenwwe_' + variation_id)) {
                           jQuery(this).css('display', 'block');
                       } else {
                           jQuery(this).css('display', 'none');
                       }
                   });
               } else {
                   jQuery('.phoen_minss').each(function () {
                       jQuery(this).find('input').val('');
                       jQuery(this).find('textarea').val('');
   
                       jQuery(this).css('display', 'none');
   
                   });
               }
           }
   
       });
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[NSFW] [Woocommerce Custom Fields For Variation] Field does not appear on Product Page.](https://wordpress.org/support/topic/field-does-not-appear-on-product-page/)
 *  [ideatic](https://wordpress.org/support/users/ideatic/)
 * (@ideatic)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/field-does-not-appear-on-product-page/#post-13078476)
 * Versión 1.1.4 is working for me, the deal with version 1.1.5 is that they forgot
   to include in the package some PHP files and assets, but they’re present in 1.1.4
   and before
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[NSFW] [Woocommerce Custom Fields For Variation] Field does not appear on Product Page.](https://wordpress.org/support/topic/field-does-not-appear-on-product-page/)
 *  [ideatic](https://wordpress.org/support/users/ideatic/)
 * (@ideatic)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/field-does-not-appear-on-product-page/#post-13077321)
 * Version 1.1.5 is broken, you should use this one while the developer fixes it:
   
   [https://downloads.wordpress.org/plugin/woo-custom-fields-for-variation.1.1.4.zip](https://downloads.wordpress.org/plugin/woo-custom-fields-for-variation.1.1.4.zip)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Product Input Fields for WooCommerce] Input field only for variation](https://wordpress.org/support/topic/input-field-only-for-variation/)
 *  Thread Starter [ideatic](https://wordpress.org/support/users/ideatic/)
 * (@ideatic)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/input-field-only-for-variation/#post-11543624)
 * That would be wonderful, thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Product Input Fields for WooCommerce] Input field only for variation](https://wordpress.org/support/topic/input-field-only-for-variation/)
 *  Thread Starter [ideatic](https://wordpress.org/support/users/ideatic/)
 * (@ideatic)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/input-field-only-for-variation/#post-11541448)
 * Hi [@komal-maru](https://wordpress.org/support/users/komal-maru/),
 * Thank you for your answer, but I was already using the ‘per product’ feature.
   What I need is a ‘per variation’ feature like the plugin I mentioned, or an easy
   way to define when a field is hidden/shown when a certain variation is selected
   inside the ‘Product Input Field #’ metabox.
 * Regards,

Viewing 6 replies - 1 through 6 (of 6 total)