for styling add_action( 'woocommerce_before_shop_loop', 'buildr_results_bar_wrapper_after', 35 ); // Wrap the Results Count and Filter Select in a for styling add_action( 'woocommerce_before_shop_loop_item_title', 'buildr_woocommerce_product_details_wrapper_before', 50 ); // Wrap the Shop loop Product content in
for styling add_action( 'woocommerce_after_shop_loop_item', 'buildr_woocommerce_product_details_wrapper_after', 50 ); // Wrap the Shop loop Product content in
for styling add_action( 'woocommerce_before_subcategory_title', 'buildr_woocommerce_product_details_wrapper_before', 50 ); // Wrap the Shop loop Category content in
for styling add_action( 'woocommerce_after_subcategory', 'buildr_woocommerce_product_details_wrapper_after', 50 ); // Wrap the Shop loop Category content in
for styling add_action( 'woocommerce_shop_loop_item_title', 'buildr_woocommerce_product_loop_category', 5 ); // Inject the Category in the Product details add_action( 'woocommerce_shop_loop_item_title', 'buildr_woocommerce_product_loop_excerpt', 20 ); // Inject the Excerpt in the Product details add_action( 'buildr_featured_products', 'buildr_render_featured_products', 10 ); // Output the Featured Products section add_action( 'after_setup_theme', 'buildr_woocommerce_setup' ); // Add WooCommerce theme support add_action( 'wp_enqueue_scripts', 'buildr_woocommerce_scripts' ); // Enqueue WooCommerce scripts add_action( 'woocommerce_single_product_summary', 'buildr_woocommerce_product_underline', 7 ); // Inject an underline after the product title add_action( 'woocommerce_single_product_summary', 'buildr_woocommerce_single_product_category', 3 ); // Inject the category before the product title add_action( 'woocommerce_after_single_product_summary', 'buildr_woocommerce_single_product_clear', 5 ); // Inject a float clear after the product summary section /** * Filters --------------------------------------------------------------------- * */ add_filter( 'woocommerce_enqueue_styles', 'buildr_woocommerce_dequeue_styles' ); // Dequeue select WooCommerce default styles add_filter( 'body_class', 'buildr_woocommerce_active_body_class' ); // Add active WooCommerce body class add_filter( 'woocommerce_output_related_products_args', 'buildr_woocommerce_related_products_args' ); // Set arguments for Related Products add_filter( 'woocommerce_add_to_cart_fragments', 'buildr_woocommerce_cart_link_fragment' ); // Code for AJAX-ed Cart subtotal updates add_filter( 'woocommerce_pagination_args', 'buildr_filter_woocommerce_pagination_args', 10, 1 ); // Filter the Pagination $args array /** * Hooked & Filtered Functions ------------------------------------------------- * */ /** * WooCommerce setup function to add_theme_support. * * @link https://docs.woocommerce.com/document/third-party-custom-theme-compatibility/ * @link https://github.com/woocommerce/woocommerce/wiki/Enabling-product-gallery-features-(zoom,-swipe,-lightbox)-in-3.0.0 * * @return void */ function buildr_woocommerce_setup() { add_theme_support( 'woocommerce' ); add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); } /** * WooCommerce specific scripts & stylesheets. * * @return void */ function buildr_woocommerce_scripts() { wp_enqueue_style( 'buildr-woocommerce-style', get_template_directory_uri() . '/woocommerce.css' ); $font_path = WC()->plugin_url() . '/assets/fonts/'; $inline_font = '@font-face { font-family: "star"; src: url("' . $font_path . 'star.eot"); src: url("' . $font_path . 'star.eot?#iefix") format("embedded-opentype"), url("' . $font_path . 'star.woff") format("woff"), url("' . $font_path . 'star.ttf") format("truetype"), url("' . $font_path . 'star.svg#star") format("svg"); font-weight: normal; font-style: normal; }'; wp_add_inline_style( 'buildr-woocommerce-style', $inline_font ); } /** * Disable the default WooCommerce stylesheet. * * Removing the default WooCommerce stylesheet and enqueing your own will * protect you during WooCommerce core updates. * * @link https://docs.woocommerce.com/document/disable-the-default-stylesheet/ */ function buildr_woocommerce_dequeue_styles( $enqueue_styles ) { unset( $enqueue_styles['woocommerce-general'] ); // Remove the gloss unset( $enqueue_styles['woocommerce-smallscreen'] ); // Remove the smallscreen optimisation // unset( $enqueue_styles['woocommerce-layout'] ); // Remove the layout return $enqueue_styles; } /** * Add 'woocommerce-active' class to the body tag. * * @param array $classes CSS classes applied to the body tag. * @return array $classes modified to include 'woocommerce-active' class. */ function buildr_woocommerce_active_body_class( $classes ) { $classes[] = 'woocommerce-active'; return $classes; } /** * Related Products Args. * * @param array $args related products args. * @return array $args related products args. */ function buildr_woocommerce_related_products_args( $args ) { $defaults = array ( 'posts_per_page' => 3, 'columns' => 3, ); $args = wp_parse_args( $defaults, $args ); return $args; } /** * Cart Fragments. * * Ensure cart contents update when products are added to the cart via AJAX. * * @param array $fragments Fragments to refresh via AJAX. * @return array Fragments to refresh via AJAX. */ function buildr_woocommerce_cart_link_fragment( $fragments ) { ob_start(); buildr_woocommerce_cart_link(); $fragments[ 'a.cart-contents' ] = ob_get_clean(); return $fragments; } /** * Cart Link. * * Displayed a link to the cart including the number of items present and the cart total. * * @return void */ function buildr_woocommerce_cart_link() { ?> cart->get_cart_contents_count(), 'buildr' ), WC()->cart->get_cart_contents_count() ) ); ?> - cart->get_cart_subtotal() ); ?> * * @return void */ function buildr_results_bar_wrapper_before() { ?>
* * @return void */ function buildr_results_bar_wrapper_after() { ?>

name ); ?>

get_id(), ', ', '', '' ); ?>
'product', 'posts_per_page' => -1, 'tax_query' => array( array( 'taxonomy' => 'product_visibility', 'field' => 'name', 'terms' => 'featured', ), ), ); $featured_products_loop = new WP_Query( $args ); ?> have_posts() ) : ?>

    have_posts() ) : $featured_products_loop->the_post(); wc_get_template_part( 'content', 'product' ); endwhile; ?>