Product Custom Fields with HTML and JS

Question

I have a custom textarea filed for the product page.

woocommerce_wp_textarea_input(
    array(
        'id' => '_custom_product_calc',
        'label' => __('Test', 'woocommerce')
    )
);

$woocommerce_custom_product_calc = $_POST['_custom_product_calc'];
if (!empty($woocommerce_custom_product_calc))
    update_post_meta($post_id, '_custom_product_calc', esc_html($woocommerce_custom_product_calc));

I need to use this field for insert some HTML code with JS. But, as you can see, the result is not what I’ve expected.

enter image description here

How can I change this? Or, maybe you know a better way to add a tab with HTML and JS for a product page? Clone Short description, for example?

Thanks!

0
, Alexander Goroshev 2 years 2019-12-04T02:47:42-05:00 0 Answers 78 views 0

Leave an answer

Browse
Browse