skip to Main Content

WordPress – Add custom input field next to WooCommerce product variation SKU field

I have created a custom field for variations of a variant product add_action('woocommerce_variation_options', 'my_field_variable', 300, 3); function my_field_variable($loop, $variation_data, $variation){ woocommerce_wp_text_input( array( 'id' => "_customscu", 'value' => get_post_meta($variation->ID, '_customscu', true), 'label' => esc_html__('CustomSCU', 'my_field'), 'desc_tip' => true, 'description' => __('Enter…

VIEW QUESTION

Jquery – How to write Textlimit Function with keeping the structure of the HTML

jQuery(function($) { $(document).ready(function() { var moreLink = 'Read more'; var lessLink = 'Read less'; // Save the original content $('.container').each(function() { var originalContent = $(this).html(); $(this).data('original-content', originalContent); }); $('.container p').each(function() { var container = $(this).parent(); var wordLimit = parseInt(container.closest(".container").attr('data-word-limit')); var…

VIEW QUESTION

How to get array input data using jquery?

My input field is as below: <input type="hidden" name="data[{{ $parentIndex }}][{{ $index }}]" value="{{ $value }}"> My sample data: <input type="hidden" name="data[0][0]" value="Name"> <input type="hidden" name="data[0][1]" value="contact_email"> <input type="hidden" name="data[0][2]" value="phone number"> <input type="hidden" name="data[0][3]" value="contact_location"> <input type="hidden" name="data[0][4]" value="">…

VIEW QUESTION
Back To Top
Search