How do I get the price field to accept text
I would like to use this field to post city/location info
Right now it will only accept numbers
Woocommerce
2 posts from 2 voices-
Posted 2 months ago #
-
In wp-content\plugins\woocommerce\admin\post-types\writepanels\writepanel-product_data.php replace:
woocommerce_wp_text_input( array( 'id' => '_regular_price', 'class' => 'wc_input_price short', 'label' => __( 'Regular Price', 'woocommerce' ) . ' ('.get_woocommerce_currency_symbol().')', 'type' => 'number', 'custom_attributes' => array( 'step' => 'any', 'min' => '0' ) ) );with:
woocommerce_wp_text_input( array( 'id' => '_regular_price', 'class' => 'wc_input_price short', 'label' => __( 'Regular Price', 'woocommerce' ) . ' ('.get_woocommerce_currency_symbol().')', 'type' => 'text', 'custom_attributes' => array( 'step' => 'any', 'min' => '0' ) ) );However probably this won't work anyway because WooCommerce expects an integer value for the price and it doesn't make sense to "hijack" this option field.
Posted 2 months ago #
Reply
You must log in to post.














