Impossible to create a new WooCommerce customer using Rest API

In the documentation of WP REST User https://wordpress.org/plugins/wp-rest-user/ you have the aswer: To perform further actions after user is registered, write and add_action: add_action(‘wp_rest_user_user_register’, ‘user_registered’); function user_registered($user) { // Do Something } Replace “// Do Something” for the code to change the user role. Something like this (not tested): $u = new WP_User( 3 ); … Read more

Woocommerce digital download not working – database error Cannot add or update a child row: a foreign key constraint fails [closed]

Just go to your database, drop table ending with “wc_download_log” (it might have a prefix). After droping the table deactivate Woocommerce and activate it again. That will solve the trick. Just be careful, drop just that table, be sure to back things up first. This post helped me solved this: https://wordpress.org/support/topic/unable-to-insert-download-log-entry-in-database/page/2/#post-13359528

How can I change the background color of divs dynamically (depending on an order-status in woocommerce)?

Your issue is a misunderstanding of how CSS/HTML works. Take this example: <style>p { color: red; }</style> <p>1</p> <style>p { color: blue; }</style> <p>2</p> <style>p { color: green; }</style> <p>3</p> Which colour is the 1st paragraph? I suspect you would answer red, but that would be incorrect. All paragraphs are green. The disconnect is that … Read more