Beispiel #1
0
function etheme_get_product_labels($product_id = '')
{
    global $post, $wpdb;
    $count_labels = 0;
    $output = '';
    if (etheme_get_option('sale_icon')) {
        if (etheme_product_on_special($product_id)) {
            $count_labels++;
            $output .= '<span class="label-icon sale-label">' . __('Sale!', ETHEME_DOMAIN) . '</span>';
        }
    }
    if (etheme_get_option('new_icon')) {
        $count_labels++;
        if (etheme_product_is_new($product_id)) {
            if ($count_labels > 1) {
                $second_label = 'second_label';
            }
            $output .= '<span class="label-icon new-label ' . $second_label . '">' . __('New!', ETHEME_DOMAIN) . '</span>';
        }
    }
    return $output;
}
Beispiel #2
0
 * Product loop sale flash
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     1.6.4
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
global $post, $product;
?>
<div class="label-product">

    <?php 
if (etheme_product_is_new($post->id) && etheme_get_option('new_icon')) {
    ?>
		<div class="type-label-1">
			<div class="new"><?php 
    _e('New', ETHEME_DOMAIN);
    ?>
</div>
		</div>
    <?php 
}
?>
	        
	<?php 
if ($product->is_on_sale() && etheme_get_option('sale_icon')) {
    ?>