Beispiel #1
0
function ss_render_sidebar_product($wp_query)
{
    $settings = get_option('shopstyler');
    echo '<h4 class="ss-promote-title">' . $settings['woo_promote_title'] . '</h4>';
    echo '<ul class="products">';
    if ($sale != '') {
        $discount = product_discount($price, $sale);
        echo '<div class="discount"><span>-' . $discount . '%</span></div>';
    }
    while ($wp_query->have_posts()) {
        $wp_query->the_post();
        $image = woocommerce_get_product_thumbnail('shop_catalog');
        $link = get_permalink(get_the_ID());
        $title = get_the_title(get_the_ID());
        $url = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
        $escaped_url = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
        $price = get_post_meta(get_the_ID(), '_regular_price', true);
        $sale = get_post_meta(get_the_ID(), '_sale_price', true);
        echo '<a href="' . $link . '">
			<figure>
				<li class="product-promote">';
        echo '<div class="product-container" style="display:block;">';
        //product image
        echo '<div class="product-image-promote img-' . get_the_ID() . '">';
        echo $image;
        echo '</div>';
        echo '<span class="title"><h2 class="ss-name-promote">' . $title . '</h2></span><br/>';
        echo '</div>';
        echo '<div class="product-caption">';
        //echo '<div style="float:right;width:100%;height:100%;padding:10% 20%;text-align:center!important;">';
        //echo '<a href="' . $link . '"><h2 style="font-size:1.5em!important">' .$title. '</h2>';
        echo '<span class="price">';
        if ($sale != '') {
            echo '<span class="amount amount-' . get_the_ID() . '">' . wc_price($sale) . '</span>';
        } else {
            echo '<span class="amount amount-' . get_the_ID() . '">' . wc_price($price) . '</span>';
        }
        echo '</span><br/>';
        echo '<div style="display:none" class="excerpt-' . get_the_ID() . '">' . get_the_excerpt() . '</div>';
        echo '</div>';
        //echo '</div>';
        echo '</li>
			</figure>
		</a>';
    }
    echo '</ul>';
    wp_reset_query();
}
function ss_render_query($wp_query,$title){
echo '<div class="cat-title ss-collateral-title">'.$title.'</div>';
echo '<div class="ss-collateral-wrapper">';
echo '<ul class="products">';
    if ( $sale != '' ){
      $discount = product_discount($price,$sale);
      echo '<div class="discount"><span>-'. $discount.'%</span></div>';
    }
while ( $wp_query->have_posts() ) : $wp_query->the_post();
    $image = woocommerce_get_product_thumbnail('shop_catalog');
	$image_url = wp_get_attachment_url( get_post_thumbnail_id(get_the_ID()) );
    $link = get_permalink ( get_the_ID() );
    $title = get_the_title( get_the_ID());
    $url =  "//$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    $escaped_url = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
    $price = get_post_meta( get_the_ID(), '_regular_price' , true);
    $sale = get_post_meta( get_the_ID(), '_sale_price', true);
      
    
    echo '<li class="product ss-collateral-product">';
      echo '<div class="product-container" style="display:block;">';
    
      //product image
      echo '<div class="product-image lbimg-'.get_the_ID().'">';
	  echo '<a href="'.$image_url.'" data-lightbox="lbimage-'.get_the_ID().'" data-title="'.get_the_title().'" class="lbimg-'.get_the_ID().'">';
      echo $image;
  	  echo '</a>';
	  
      //echo '<div class="product-caption">';
      //echo '<div style="float:right;width:100%;height:100%;padding:10% 20%;text-align:center!important;">';
      //echo '<a href="' . $link . '"><h2 style="font-size:1.5em!important">' .$title. '</h2>';
	echo '</div><div style="float:left;padding-left:2%;">';
      echo '<a href="' . $link . '"><span class="title"><h2>'.$title.'</h2></span>';
      echo '<span class="price">';
      if ( $sale != '' ){
        echo '<span class="amount amount-'.get_the_ID().'">' . wc_price($sale) . '</span>';
      } else {
        echo '<span class="amount amount-'.get_the_ID().'">' . wc_price($price) . '</span>';
      }
      echo'</span>';
  
      //echo woo_star_rating();
     
   	  ss_loop_rating();
	  echo '</a><div style="position:absolute;top:0;right:0">';
      ss_loop_quickview();
	  echo '</div>';
      //echo '<button class="button btn-modal" 
        //name="'.get_the_ID().'|'.$link.'|'.$title.'" style="text-transform:none!important;"><span class="fa fa-search"></span></button>';      
      //echo '&nbsp;<a href="' . $link . '">';
      //echo '<button class="button">More</button>';   
      //echo '</a>';
      
  
      
      echo '<div style="display:none" class="excerpt-'.get_the_ID().'">'.get_the_excerpt().'</div>';
     
      echo '</div>';
	  
	  echo '</div>';
	  
  echo '</li>';
endwhile;
echo '</ul></div>';
}