/**
  * Display On Sale Products
  * Hooked into the `homepage` action in the homepage template
  * @since  1.0.0
  * @return void
  */
 function storefront_on_sale_products($args)
 {
     if (is_woocommerce_activated()) {
         $args = apply_filters('storefront_on_sale_products_args', array('limit' => 4, 'columns' => 4, 'title' => __('On Sale', 'storefront')));
         echo '<section class="storefront-product-section storefront-on-sale-products">';
         do_action('storefront_homepage_before_on_sale_products');
         echo '<h2 class="section-title">' . wp_kses_post($args['title']) . '</h2>';
         do_action('storefront_homepage_after_on_sale_products_title');
         echo storefront_do_shortcode('sale_products', array('per_page' => intval($args['limit']), 'columns' => intval($args['columns'])));
         do_action('storefront_homepage_after_on_sale_products');
         echo '</section>';
     }
 }
/**
 * Storefront shop messages
 * @since   1.4.4
 * @uses    do_shortcode
 */
function storefront_shop_messages()
{
    if (!is_checkout()) {
        echo wp_kses_post(storefront_do_shortcode('woocommerce_messages'));
    }
}
Example #3
0
 function storefront_promoted_products($per_page = '2', $columns = '2', $recent_fallback = true)
 {
     if (is_woocommerce_activated()) {
         if (wc_get_featured_product_ids()) {
             echo '<h2>' . esc_html__('Featured Products', 'storefront') . '</h2>';
             echo storefront_do_shortcode('featured_products', array('per_page' => $per_page, 'columns' => $columns));
         } elseif (wc_get_product_ids_on_sale()) {
             echo '<h2>' . esc_html__('On Sale Now', 'storefront') . '</h2>';
             echo storefront_do_shortcode('sale_products', array('per_page' => $per_page, 'columns' => $columns));
         } elseif ($recent_fallback) {
             echo '<h2>' . esc_html__('New In Store', 'storefront') . '</h2>';
             echo storefront_do_shortcode('recent_products', array('per_page' => $per_page, 'columns' => $columns));
         }
     }
 }
Example #4
0
    the_widget('WC_Widget_Product_Search');
} else {
    get_search_form();
}
?>

					<?php 
if (is_woocommerce_activated()) {
    echo '<div class="fourohfour-columns-2">';
    echo '<div class="col-1">';
    echo '<h2>' . esc_html__('Featured Products', 'storefront') . '</h2>';
    echo storefront_do_shortcode('featured_products', array('per_page' => 2, 'columns' => 2));
    echo '</div>';
    echo '<div class="col-2">';
    echo '<h2>' . esc_html__('Product Categories', 'storefront') . '</h2>';
    the_widget('WC_Widget_Product_Categories', array('count' => 1));
    echo '</div>';
    echo '</div>';
    echo '<h2>' . esc_html__('Popular Products', 'storefront') . '</h2>';
    echo storefront_do_shortcode('best_selling_products', array('per_page' => 4, 'columns' => 4));
}
?>

				</div><!-- .page-content -->
			</section><!-- .error-404 -->

		</main><!-- #main -->
	</div><!-- #primary -->

<?php 
get_footer();
Example #5
0
    the_widget('WC_Widget_Product_Search');
} else {
    get_search_form();
}
?>

					<?php 
if (is_woocommerce_activated()) {
    echo '<div class="fourohfour-columns-2">';
    echo '<div class="col-1">';
    echo '<h2>' . esc_attr(__('Featured Products', 'storefront')) . '</h2>';
    echo storefront_do_shortcode('featured_products', array('per_page' => intval('2'), 'columns' => intval('2')));
    echo '</div>';
    echo '<div class="col-2">';
    echo '<h2>' . esc_attr(__('Product Categories', 'storefront')) . '</h2>';
    the_widget('WC_Widget_Product_Categories', array('count' => 1));
    echo '</div>';
    echo '</div>';
    echo '<h2>' . __('Popular Products', 'storefront') . '</h2>';
    echo storefront_do_shortcode('best_selling_products', array('per_page' => intval('4'), 'columns' => intval('4')));
}
?>

				</div><!-- .page-content -->
			</section><!-- .error-404 -->

		</main><!-- #main -->
	</div><!-- #primary -->

<?php 
get_footer();
 /**
  * Display Best Selling Products
  * Hooked into the `homepage` action in the homepage template
  *
  * @since 2.0.0
  * @param array $args the product section args.
  * @return void
  */
 function storefront_best_selling_products($args)
 {
     if (is_woocommerce_activated()) {
         $args = apply_filters('storefront_best_selling_products_args', array('limit' => 4, 'columns' => 4, 'title' => esc_attr__('Best Sellers', 'storefront')));
         echo '<section class="storefront-product-section storefront-best-selling-products" aria-label="Best Selling Products">';
         do_action('storefront_homepage_before_best_selling_products');
         echo '<h2 class="section-title">' . wp_kses_post($args['title']) . '</h2>';
         do_action('storefront_homepage_after_best_selling_products_title');
         echo storefront_do_shortcode('best_selling_products', array('per_page' => intval($args['limit']), 'columns' => intval($args['columns'])));
         do_action('storefront_homepage_after_best_selling_products');
         echo '</section>';
     }
 }