Override the plugin class and function

thanks… I dont know if is this good way, but this code in the child theme functions.php is working for me: add_filter(‘woocommerce_product_class’, ‘myFunction’, 10, 4); function myFunction($classname, $product_type, $post_type, $product_id) { $classname=”SUB_WC_Product_my”; return $classname; } class SUB_WC_Product_my extends SUB_WC_Product { public function get_product_price( $context=”view” ) { return “AB”; } }

wordpress Ajax success doesn’t return the value

You can try this… …rather than returning the value, send a JSON success message. $response = new WP_REST_Response($final_price_return, 200); wp_send_json_success( $response ); wp_die(); //you have to end the process, so if you’re getting just a 0 returned in your JS success, it’s because of this. Then, in your JS/jQuery: success: function (success, data) { var … Read more

WordPress Hooks : Where to place callbacks that repetitively yield the same effect?

Long-running software may be able to register functionality once and leverage those registrations for every connection across the lifetime of the process, but in the case of WordPress (and most of the PHP web software landscape as a whole) the long-running connection management is offloaded to the web server software. WordPress executes from the top … Read more

I want to disable certain file types from upload from dokan description field

The code you have added has an undefined constant which might create an issue with the latest PHP versions. Instead, you may use the code given below which will allow you to add media to the short description and description. add_filter(‘dokan_product_short_description’, ‘add_media_button’); add_filter(‘dokan_product_description’, ‘add_media_button’); function add_media_button(){ return array( ‘media_buttons’ => true ); } After adding … Read more