get('Version') ); wp_enqueue_script( 'bcf-shop-customselect', get_stylesheet_directory_uri().'/js/customselect.js', 0, '1.1', true ); wp_enqueue_script( 'bcf-shop-woocommerce', get_stylesheet_directory_uri().'/js/woocommerce.js', 0, '1.1', true ); } add_action( 'wp_enqueue_scripts', 'bcf_shop_enqueue_child_styles',9999 ); /*Write here your own functions */ /* * 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 bcf_shop_active_body_class( $classes ) { $classes[] = 'woocommerce-active'; $classes[] = 'woocommerce'; $classes[] = 'woocommerce-js'; $classes[] = 'woocommerce-js'; return $classes; } add_filter( 'body_class', 'bcf_shop_active_body_class' ); /** * Product gallery thumnbail columns. * * @return integer number of columns. */ function bcf_shop_woocommerce_thumbnail_columns() { return 3; } add_filter( 'woocommerce_product_thumbnails_columns', 'bcf_shop_woocommerce_thumbnail_columns' ); /** * Related Products Args. * * @param array $args related products args. * @return array $args related products args. */ function bcf_shop_woocommerce_related_products_args( $args ) { $defaults = array( 'posts_per_page' => 9, 'columns' => 3, ); $args = wp_parse_args( $defaults, $args ); return $args; } add_filter( 'woocommerce_output_related_products_args', 'bcf_shop_woocommerce_related_products_args' ); /** * Default loop columns on product archives. * * @return integer products per row. */ function bcf_shop_woocommerce_loop_columns() { return 3; } add_filter( 'loop_shop_columns', 'bcf_shop_woocommerce_loop_columns' ); /* TOOL BAR */ remove_action('woocommerce_before_shop_loop','woocommerce_result_count',20); if ( ! function_exists( 'bcf_shop_header_toolbar_start' ) ) { /** * Insert the opening anchor tag for products in the loop. */ function bcf_shop_header_toolbar_start() { echo '
'; } add_action('woocommerce_before_shop_loop','bcf_shop_header_toolbar_end',30); } if ( ! function_exists( 'bcf_shop_loop_shop_per_page' ) ) : /** * Returns correct posts per page for the shop * * @since 1.0.0 */ function bcf_shop_loop_shop_per_page() { $posts_per_page = ( isset( $_GET['products-per-page'] ) ) ? sanitize_text_field( wp_unslash( $_GET['products-per-page'] ) ) : get_theme_mod( 'shopstore_woo_shop_posts_per_page',12 ); if ( $posts_per_page == 'all' ) { $posts_per_page = wp_count_posts( 'product' )->publish; } return $posts_per_page; } add_filter( 'loop_shop_per_page', 'bcf_shop_loop_shop_per_page', 20 ); endif; /** * loop product after div add. * * @return integer products per row. */ function bcf_shop_loop_item_before() { echo '