'', 'id' => '', 'cat_slug' => '', 'number_posts' => 10, 'show_cats' => 'yes', 'show_price' => 'yes', 'show_buttons' => 'yes', 'picture_size' => 'fixed' ), $args ); extract( $defaults ); self::$args = $defaults; $html = ''; $buttons = ''; if( class_exists( 'Woocommerce' ) ) { $number_posts = (int) $number_posts; $args = array( 'post_type' => 'product', 'posts_per_page' => $number_posts, 'meta_query' => array( array( 'key' => '_thumbnail_id', 'compare' => '!=', 'value' => null ) ) ); if( $cat_slug ) { $cat_id = explode( ',', $cat_slug ); $args['tax_query'] = array( array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => $cat_id ) ); } $css_class = 'simple-products-slider'; if( $picture_size != 'fixed' ) { $css_class = 'simple-products-slider-variable'; } $products = new WP_Query( $args ); $products_wrapper = $product = ''; if( $products->have_posts() ) { while( $products->have_posts() ) { $products->the_post(); $image = $price_tag = $terms = ''; if( has_post_thumbnail() ) { if( $smof_data['image_rollover'] ) { $image = get_the_post_thumbnail( get_the_ID(), 'shop_catalog' ); } else { $image = sprintf( '%s', get_permalink( get_the_ID() ), get_the_post_thumbnail( get_the_ID(), 'shop_catalog' ) ); } if( $show_cats == 'yes' ) { $terms = get_the_term_list(get_the_ID(), 'product_cat', sprintf( '', FusionCore_Plugin::attributes( 'cats' ) ), ', ', ''); } ob_start(); woocommerce_get_template( 'loop/price.php' ); $price = ob_get_contents(); ob_end_clean(); if( $price && $show_price == 'yes' ) { $price_tag = $price; } if( $show_buttons == 'yes' ) { ob_start(); woocommerce_get_template('loop/add-to-cart.php'); $cart_button = ob_get_contents(); ob_end_clean(); $buttons = sprintf( '