/**
  * Return "Add to Wishlist" button.
  * 
  * @since 1.0.0
  */
 static function add_to_wishlist($atts, $content = null)
 {
     global $product, $yith_wcwl;
     $html = YITH_WCWL_UI::add_to_wishlist_button($yith_wcwl->get_wishlist_url(), $product->product_type, $yith_wcwl->is_product_in_wishlist($product->id));
     $html .= YITH_WCWL_UI::popup_message();
     return $html;
 }
Esempio n. 2
0
function sb_wishlist_button($attr, $content = null)
{
    global $product, $yith_wcwl;
    if ($yith_wcwl->is_product_in_wishlist($product->id)) {
        ?>
		<a class="product-in-wishlist" href="<?php 
        echo esc_url($yith_wcwl->get_wishlist_url());
        ?>
" target="_blank">
			<i class="icon-add-1"></i>
			<?php 
        _e('Wishlist', 'dfd');
        ?>
		</a>
	<?php 
    } else {
        ?>
	<a class="add_to_wishlist" data-product-type="<?php 
        echo $product->product_type;
        ?>
" data-product-id="<?php 
        echo $product->id;
        ?>
" href="<?php 
        echo esc_url($yith_wcwl->get_addtowishlist_url());
        ?>
">
		<i class="icon-add-1"></i>
		<?php 
        _e('Wishlist', 'dfd');
        ?>
	</a>
	<?php 
        echo YITH_WCWL_UI::popup_message();
    }
}
Esempio n. 3
0
		                        <td class="product-quantity">
		                            <?php 
            $availability = $product_obj->get_availability();
            $stock_status = $availability['class'];
            if ($stock_status == 'out-of-stock') {
                $stock_status = "Out";
                echo '<span class="wishlist-out-of-stock">' . __('Out of Stock', THB_THEME_NAME) . '';
            } else {
                $stock_status = "In";
                echo '<span class="wishlist-in-stock">' . __('In Stock', THB_THEME_NAME) . '';
            }
            ?>
		                        </td>
		                        <td class="product-add-to-cart shop-buttons">
		                            <?php 
            echo YITH_WCWL_UI::add_to_cart_button($values['prod_id'], $availability['class']);
            ?>
		                        </td>
		                        <td class="product-remove"><div><a href="javascript:void(0)" onclick="remove_item_from_wishlist( '<?php 
            echo esc_url($yith_wcwl->get_remove_url($values['ID']));
            ?>
', 'yith-wcwl-row-<?php 
            echo $values['ID'];
            ?>
');" class="remove" title="<?php 
            _e('Remove this product', THB_THEME_NAME);
            ?>
"><i class="icon-budicon-543"></i></a></td>
		                    </tr>
		                    <?php 
        }
Esempio n. 4
0
<?php

/**
 * Share template
 *
 * @author Your Inspiration Themes
 * @package YITH WooCommerce Wishlist
 * @version 1.1.5
 */
global $yith_wcwl;
if (get_option('yith_wcwl_share_fb') == 'yes' || get_option('yith_wcwl_share_twitter') == 'yes' || get_option('yith_wcwl_share_pinterest') == 'yes' || get_option('yith_wcwl_share_googleplus') == 'yes' || get_option('yith_wcwl_share_email') == 'yes') {
    $share_url = $yith_wcwl->get_wishlist_url();
    $share_url .= get_option('permalink-structure') != '' ? '&amp;user_id=' : '?user_id=';
    $share_url .= get_current_user_id();
    echo YITH_WCWL_UI::get_share_links($share_url);
}
Esempio n. 5
0
<?php

/**
 * Share template
 *
 * @author Your Inspiration Themes
 * @package YITH WooCommerce Wishlist
 * @version 1.0.0
 */
global $yith_wcwl;
if (!is_user_logged_in()) {
    return;
}
if (get_option('yith_wcwl_share_fb') == 'yes' || get_option('yith_wcwl_share_twitter') == 'yes' || get_option('yith_wcwl_share_pinterest') == 'yes') {
    echo YITH_WCWL_UI::get_share_links($yith_wcwl->get_wishlist_url() . '&user_id=' . get_current_user_id());
}
Esempio n. 6
0
/**
 * Output wishlist button on product archive only if yith_wcwl_add_to_wishlist plugin is installed
 *
 * @since 1.2.0
 * @return void
 */
function bearded_wishlist_button()
{
    if (function_exists('shortcode_exists') && shortcode_exists('yith_wcwl_add_to_wishlist') && class_exists('YITH_WCWL')) {
        global $yith_wcwl, $product;
        $url = $yith_wcwl->get_wishlist_url();
        $product_type = $product->product_type;
        $exists = $yith_wcwl->is_product_in_wishlist($product->id);
        $icon = '<i class="icon-star"></i>';
        $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 . '" data-product-type="' . $product_type . '" ' . $classes . ' >' . $icon . '</a>';
        $html .= '</div>';
        $html .= '<div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;"><a href="' . esc_url($url) . '"><i class="icon-ok"></i></a></div>';
        $html .= '<div class="yith-wcwl-wishlistexistsbrowse ' . ($exists ? 'show' : 'hide') . '" style="display:' . ($exists ? 'block' : 'none') . '"><a href="' . esc_url($url) . '"><i class="icon-ok"></i></a></div>';
        $html .= '<div style="clear:both"></div><div class="yith-wcwl-wishlistaddresponse"></div>';
        $html .= '</div>';
        $html .= '<div class="clear"></div>';
        $html .= YITH_WCWL_UI::popup_message();
        echo $html;
    }
}
                                                            $stock_status = "In";
                                                            echo '<span class="wishlist-in-stock">' . __( 'In Stock', 'yit' ) . '</span>';
                                                        }
                                                        ?>
                                                  
                                                <?php endif ?>
                                                
                                            </p>
                                        </div>
                                        
                                        
                                        
                                        <?php if( get_option( 'yith_wcwl_add_to_cart_show' ) == 'yes' ) : ?>
                                            
                                                <?php if(isset($stock_status) && $stock_status != 'Out'): ?>
                                                    <?php echo YITH_WCWL_UI::add_to_cart_button( $values['prod_id'], isset($availability['class']) ); ?>
                                                <?php endif ?>
                                            
                                        <?php endif ?>

                                        <a href="javascript:void(0)" onclick="<?php echo $remove_wishlist ?>" class="remove wishlist-remove" title="<?php _e( 'Remove this product', 'yit' ) ?>">&times;</a>

                                    </td>
                                    
                                </tr>
                            <?php
                            endif;
                        endforeach;
                    else: ?>
                        <tr>
                            <td colspan="6" class="wishlist-empty" ><?php _e( 'No products were added to the wishlist', 'yit' ) ?></td>