'; echo '
'; } } if ( ! function_exists( 'bigwigs_woocommerce_wrapper_end' ) ) { function bigwigs_woocommerce_wrapper_end() { echo '
'; echo '
'; /* Get Sidebar #secondary */ get_sidebar(); echo '
'; echo ''; } } /** * Change the markup the woocommerce pagination by default */ function bigwigs_woo_pagination( $args ) { $args['prev_text'] = __('Previous','bigwigs'); $args['next_text'] = __('Next','bigwigs'); $args['type'] = 'plain'; return $args; } add_filter( 'woocommerce_pagination_args', 'bigwigs_woo_pagination' ); /** * Change the layout before each item product listing */ function bigwigs_before_shop_loop_item_title() { echo '
'; } add_action ( 'woocommerce_before_shop_loop_item_title', 'bigwigs_before_shop_loop_item_title' ); /** * Change the layout after each item product listing */ function bigwigs_after_shop_loop_item() { echo '
'; } add_action ( 'woocommerce_after_shop_loop_item', 'bigwigs_after_shop_loop_item' ); /** * A form classes change function * * Modify each individual input type $args defaults * Author: Adriano Monecchi http://stackoverflow.com/a/36724593/307826 * * @param string $args Form attributes. * @param string $key Not in use. * @param null $value Not in use. * * @return mixed */ add_filter( 'woocommerce_form_field_args', 'bigwigs_wc_form_field_args', 10, 3 ); if ( ! function_exists( 'bigwigs_wc_form_field_args' ) ) { function bigwigs_wc_form_field_args( $args, $key, $value = null ) { // Start field type switch case. switch ( $args['type'] ) { /* Targets all select input type elements, except the country and state select input types */ case 'select': // Add a class to the field's html element wrapper - woocommerce // input types (fields) are often wrapped within a

tag. $args['class'][] = 'form-group'; // Add a class to the form input itself. $args['input_class'] = array( 'form-control', '' ); $args['label_class'] = array( 'control-label' ); //$args['custom_attributes']['data-plugin'] = 'select2'; $args['custom_attributes'] = array( 'data-plugin' => 'select2', 'data-allow-clear' => 'true', 'aria-hidden' => 'true', // Add custom data attributes to the form input itself. ); break; // By default WooCommerce will populate a select with the country names - $args // defined for this specific input type targets only the country select element. case 'country': $args['class'][] = 'form-group single-country'; $args['label_class'] = array( 'control-label' ); break; // By default WooCommerce will populate a select with state names - $args defined // for this specific input type targets only the country select element. case 'state': // Add class to the field's html element wrapper. $args['class'][] = 'form-group'; // add class to the form input itself. $args['input_class'] = array( '', '' ); $args['label_class'] = array( 'control-label' ); //$args['custom_attributes']['data-plugin'] = 'select2'; $args['custom_attributes'] = array( 'data-plugin' => 'select2', 'data-allow-clear' => 'true', 'aria-hidden' => 'true', ); break; case 'password': case 'text': case 'email': case 'tel': case 'number': $args['class'][] = 'form-group'; $args['input_class'] = array( 'form-control', '' ); $args['label_class'] = array( 'control-label' ); break; case 'textarea': $args['input_class'] = array( 'form-control', '' ); //$args['label_class'] = array( 'control-label' ); break; case 'checkbox': $args['label_class'] = array( 'form-check-label' ); $args['input_class'] = array( 'form-check-input', '' ); break; case 'radio': $args['label_class'] = array( 'form-check-input' ); $args['input_class'] = array( 'form-check-label', '' ); break; default: $args['class'][] = 'form-group'; $args['input_class'] = array( 'form-control', '' ); //$args['label_class'] = array( 'control-label' ); break; } // end switch ($args). return $args; } } /** * Change the markup the count category */ function bigwigs_count_category_html( $html, $category ){ $html = ' ' . esc_html( $category->count ) . ''; return $html; } add_filter( 'woocommerce_subcategory_count_html', 'bigwigs_count_category_html', 10, 2 ); /** * Change the markup the sale badge */ function bigwigs_sale_badge_html($content, $post, $product){ $html = ''.__( 'Sale', 'bigwigs' ).''; return $html; } add_filter('woocommerce_sale_flash', 'bigwigs_sale_badge_html', 10, 3);