Override functions and template
-
Hello,
I need to change the “Default Wishlist” text in get_multiple_wishlist function in /wish-list-for-woocommerce/includes/class-alg-wc-wish-list-ajax.php, I try to override this function in my child theme in functions.php but it doesn’t work, this is my code :
if (class_exists('Alg_WC_Wish_List_Ajax')) { remove_action( 'wp_ajax_alg_wc_function', array( 'Alg_WC_Wish_List_Ajax', 'get_multiple_wishlist' ) ); remove_action( 'wp_ajax_nopriv_alg_wc_wl_function', array( 'Alg_WC_Wish_List_Ajax', 'get_multiple_wishlist' ) ); $new_alg_wc_wish_list_ajax_instance = new Alg_WC_Wish_List_Ajax(); add_action( 'wp_ajax_alg_wc_function', array( $new_alg_wc_wish_list_ajax_instance, 'get_multiple_wishlist_new' ) ); add_action( 'wp_ajax_nopriv_alg_wc_wc_function', array( $new_alg_wc_wish_list_ajax_instance, 'get_multiple_wishlist_new' ) ); } function get_multiple_wishlist_new() { ... }
What is the problem in my code, why it doesn’t work ?
Next, I try to paste the template wish-list.php, I paste this in child_theme/plugins/wish-list-for-woocommerce/templates/wish-list.php, to change the text “Default Wishlist” but it doesn’t work,
Do I need to add something in my functions.php ?
Thank you,
Regards,
- The topic ‘Override functions and template’ is closed to new replies.