I have extended the YITH_WCWL_UI class in my Child Theme.
So you could do something like this. Just copy and paste the ‘add_to_wishlist_button’ from the plugin function in and edit.
class MY_YITH extends YITH_WCWL_UI {
public static function add_to_wishlist_button( $url, $product_type, $exists ) {
global $yith_wcwl, $product;
$label = apply_filters( 'yith_wcwl_button_label', get_option( 'yith_wcwl_add_to_wishlist_text' ) );
$icon = get_option( 'yith_wcwl_add_to_wishlist_icon' ) != 'none' ? '<i class="' . get_option( 'yith_wcwl_add_to_wishlist_icon' ) . '"></i>' : '';
$classes = get_option( 'yith_wcwl_use_button' ) == 'yes' ? 'class="add_to_wishlist single_add_to_wishlist button alt"' : 'class="add_to_wishlist"';
$html = '<div class="yith-wcwl-add-to-wishlist">';
$html .= '<div class="yith-wcwl-add-button'; // the class attribute is closed in the next row
$html .= $exists ? ' hide" style="display:none;"' : ' show"';
$html .= '><a href="' . esc_url( $yith_wcwl->get_addtowishlist_url() ) . '" data-product-id="' . $product->id . '" data-product-type="' . $product_type . '" ' . $classes . ' ><i class="fa fa-hand-o-right"></i> '. $label . '</a>';
$html .= '</div>';
$html .= '<div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;"><span class="feedback"><i class="fa fa-thumbs-o-up"></i> ' . __( 'Product added!','yit' ) . '</span></div>';
$html .= '<div class="yith-wcwl-wishlistexistsbrowse ' . ( $exists ? 'show' : 'hide' ) . '" style="display:' . ( $exists ? 'block' : 'none' ) . '"><span class="feedback"><i class="fa fa-thumbs-o-up"></i> ' . __( 'Product In Wishlist', 'yit' ) . '</span></div>';
$html .= '<div style="clear:both"></div><div class="yith-wcwl-wishlistaddresponse"></div>';
$html .= '</div>';
$html .= '<div class="clear"></div>';
return $html;
}
}
Then include it in your template. I personally, have this in function which is called on add_action().
MY_YITH::add_to_wishlist_button( $yith_wcwl->get_wishlist_url(), $product->product_type, $yith_wcwl->is_product_in_wishlist( $product->id ) )