Advertisement
asadsuman

CustomWishlistUIClass

Jan 3rd, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. class MY_YITH extends YITH_WCWL_UI {
  2.  
  3. public static function add_to_wishlist_button( $url, $product_type, $exists ) {
  4. global $yith_wcwl, $product;
  5.  
  6. $label = apply_filters( 'yith_wcwl_button_label', get_option( 'yith_wcwl_add_to_wishlist_text' ) );
  7. $icon = get_option( 'yith_wcwl_add_to_wishlist_icon' ) != 'none' ? '<i class="' . get_option( 'yith_wcwl_add_to_wishlist_icon' ) . '"></i>' : '';
  8.  
  9. $classes = get_option( 'yith_wcwl_use_button' ) == 'yes' ? 'class="add_to_wishlist single_add_to_wishlist button alt"' : 'class="add_to_wishlist"';
  10.  
  11. $html = '<div class="yith-wcwl-add-to-wishlist">';
  12. $html .= '<div class="yith-wcwl-add-button'; // the class attribute is closed in the next row
  13.  
  14. $html .= $exists ? ' hide" style="display:none;"' : ' show"';
  15.  
  16. $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>';
  17. $html .= '</div>';
  18.  
  19. $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>';
  20. $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>';
  21. $html .= '<div style="clear:both"></div><div class="yith-wcwl-wishlistaddresponse"></div>';
  22.  
  23. $html .= '</div>';
  24. $html .= '<div class="clear"></div>';
  25.  
  26. return $html;
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement