Ajax call not working

I have updated the code in your shared code. Please ask in the comments if you did not get changes. add_action(‘wp_ajax_dynamic_price’, ‘get_update_dynamic_price_xyz’); add_action(‘wp_ajax_nopriv_dynamic_price’, ‘get_update_dynamic_price_xyz’); function get_update_dynamic_price_xyz() { global $product; /** * Get the discount details of given product with custom price * @param $price float/integer * @param $product object (Product object Example: wc_get_product($product_id)) * @param … Read more

WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?

So I would take of on your html form the onsubmit()=…, once isnt needed and your javascript function should only have something like this. document.getElementById(“form_1”).style.display = “none”; or document.getElementById(“form_1”).style.visibility = “hidden”; this should do the job, if for some reason it does not, change the onclick from the input to the form tag. Your code … Read more

Issue adding sub category programmatically

with this code we add a new main category wp_insert_term( ‘My New Category’, ‘product_cat’, array(‘parent’ => 0)); then knowing the category parent id we can add a sub category like so wp_insert_term( ‘My New Sub-category’, ‘product_cat’, array(‘parent’ => 72)); this is more or less what you have, but when I run the function get_terms I … Read more