Beispiel #1
0
if (!isset($yith_wcwl)) {
    $yith_wcwl = new YITH_WCWL($_REQUEST);
}
// Remove product from the wishlist
if ($_GET['action'] == 'remove_from_wishlist') {
    $count = yith_wcwl_count_products();
    if ($yith_wcwl->remove($_GET['wishlist_item_id'])) {
        _e('Product successfully removed.', 'yit');
    } else {
        echo '#' . $count . '#';
        _e('Error. Unable to remove the product from the wishlist.', 'yit');
    }
    if (!$count) {
        _e('No products were added to the wishlist', 'yit');
    }
    wp_redirect($yith_wcwl->get_wishlist_url());
    die;
} elseif ($_GET['action'] == 'add_to_wishlist') {
    $return = $yith_wcwl->add();
    if ($return == 'true') {
        echo $return . '##' . __('Product added!', 'yit');
    } elseif ($return == 'exists') {
        echo $return . '##' . __('Product already in the wishlist.', 'yit');
    } elseif (count($yith_wcwl->errors) > 0) {
        echo $yith_wcwl->get_errors();
    }
    wp_redirect(get_permalink(intval($_GET['add_to_wishlist'])));
    die;
} elseif ($_GET['action'] == 'prod_find') {
    if ($yith_wcwl->is_product_in_wishlist($_POST['prod_id'])) {
        echo "exists";
Beispiel #2
0
							<div class="side-area-icon hidden-phone hidden-tablet"><i class="icon-reorder"></i></div>
						<?php 
    }
    ?>
						-->
						<div class="right" style="padding-top:5px">
						<span>
							<a class="hidden-desktop" style="padding-left: 0px; padding-bottom: 0px;" href="./?page_id=7"><img src="./wp-content/themes/legenda/framework/dT6ao7obc-copy-90x90.png" alt="" style="width:20px;height:20px;"></a>
						</span>				
						<?php 
    if (class_exists('YITH_WCWL') && etheme_get_option('wishlist_link')) {
        $wl = new YITH_WCWL(array());
        ?>
							<span class="wishlist-link hidden-tablet">
								<a href="<?php 
        echo $wl->get_wishlist_url();
        ?>
"><i class="icon-heart-empty"></i><span><?php 
        _e('Wishlist', ETHEME_DOMAIN);
        ?>
</span></a>
							</span>
						<?php 
    }
    ?>
						<span>
							<div class="hidden-desktop" style="margin-right:10px;margin-left:10px">
								<a href="./?page_id=166&amp;wishlist-action=view"><i style="color:grey" class="fa fa-heart-o"></i><span></span></a>
							</div>
						</span>
						<span><a class="hidden-desktop hidden-phone" href="./?page_id=2038" style="margin-right:5px;margin-left:0px; color:grey"><i style="color:grey" class="fa fa-book"></i> Guide</a></span>