function et_wishlist_btn($label = '') { global $yith_wcwl, $product; if (!class_exists('YITH_WCWL')) { return; } return YITH_WCWL_Shortcode::add_to_wishlist(array()); $html = ''; if ($label == '') { $label = __('Add to Wishlist', ETHEME_DOMAIN); } $exists = $yith_wcwl->is_product_in_wishlist($product->id); $url = $yith_wcwl->get_wishlist_url(); $classes = '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 . '" ' . $classes . ' >' . $label . '</a>'; $html .= '<img src="' . esc_url(admin_url('images/wpspin_light.gif')) . '" class="ajax-loading" id="add-items-ajax-loading" alt="" width="16" height="16" style="visibility:hidden" />'; $html .= '</div>'; $html .= '<div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;"><a href="' . esc_url($url) . '">' . apply_filters('yith-wcwl-browse-wishlist-label', __('Browse Wishlist', 'yit')) . '</a></div>'; $html .= '<div class="yith-wcwl-wishlistexistsbrowse ' . ($exists ? 'show' : 'hide') . '" style="display:' . ($exists ? 'block' : 'none') . '"><a href="' . esc_url($url) . '">' . apply_filters('yith-wcwl-browse-wishlist-label', __('Browse Wishlist', 'yit')) . '</a></div>'; $html .= '<div style="clear:both"></div><div class="yith-wcwl-wishlistaddresponse"></div>'; $html .= '</div>'; return $html; }
?> <div class="product-controls-wrapper" data-product-link="<?php the_permalink(); ?> "> <div class="buttons-wrapper"> <?php // woocommerce_before_shop_loop_item_title hook do_action('woocommerce_before_shop_loop_item_title'); // add to wishlist button if (class_exists('YITH_WCWL_Shortcode') && get_option('yith_wcwl_enabled') == true) { $atts = array('per_page' => 10, 'pagination' => 'no'); echo YITH_WCWL_Shortcode::add_to_wishlist($atts); } ?> <span class="product-tooltip"></span> </div> <div class="vertical-helper"></div> </div> </div><!-- .animation-section ends --> <div class="product-description-wrapper">