I found the answer if someone was wondering.
// Get value from post data // Don't use woocommerce_clean as it destroys sanitized characters $value = sanitize_title( trim( stripslashes( $_REQUEST[ $taxonomy ] ) ) );
The previous one is on line 339 in woocommerce-functions.php. It must be changed to:
$value = trim( stripslashes( $_REQUEST[ $taxonomy ] ) )
Now itβs just a matter of overriding this file correctly. I copied the original function from woocommerce-functions.php and added it to my functions.php theme. Then I changed it so that it does not sanitize user input.
This is what I added functions.php to my theme:
add_action( 'init', 'override_add_to_cart_action' ); function override_add_to_cart_action( $url = false ) { // Original function is woocommerce_add_to_cart_action() // ... full function above and below $value = trim( stripslashes( $_REQUEST[ $taxonomy ] ) ); // ... }
Thus, we do not need to change the kernel files, allowing us to update the plugin when necessary. :)
source share