'; echo '
'; echo '
'; get_template_part( 'global-templates/left-sidebar-check' ); echo '
'; } } if ( ! function_exists( 'understrap_woocommerce_wrapper_end' ) ) { /** * Display the theme specific end of the page wrapper. */ function understrap_woocommerce_wrapper_end() { echo '
'; get_template_part( 'global-templates/right-sidebar-check' ); echo '
'; echo '
'; echo ''; } } if ( ! function_exists( 'understrap_wc_form_field_args' ) ) { /** * Modifies the form field's arguments by input type. The arguments are used * in `woocommerce_form_field()` to build the form fields. * * @see https://woocommerce.github.io/code-reference/namespaces/default.html#function_woocommerce_form_field * * @param array $args Form field arguments. * @param string $key Value of the fields name attribute. * @param string|null $value Value of element of type 'country' * with the country names. */ // Add class to the form field's html element wrapper. $args['class'][] = 'single-country'; break; case 'state': /* * WooCommerce will populate a elements, except the country and state `+`' ); $field = substr_replace( $field, '', $strpos, strlen( '' ) ); } return $field; } } if ( ! is_admin() && ! function_exists( 'wc_review_ratings_enabled' ) ) { /** * Check if reviews are enabled. * * Function introduced in WooCommerce 3.6.0., include it for backward compatibility. * * @return bool */ function wc_reviews_enabled() { return 'yes' === get_option( 'woocommerce_enable_reviews' ); } /** * Check if reviews ratings are enabled. * * Function introduced in WooCommerce 3.6.0., include it for backward compatibility. * * @return bool */ function wc_review_ratings_enabled() { return wc_reviews_enabled() && 'yes' === get_option( 'woocommerce_enable_review_rating' ); } } if ( ! function_exists( 'understrap_quantity_input_classes' ) ) { /** * Add Bootstrap class to quantity input field. * * @param array $classes Array of quantity input classes. * @return array */ function understrap_quantity_input_classes( $classes ) { $classes[] = 'form-control'; return $classes; } } if ( ! function_exists( 'understrap_loop_add_to_cart_link' ) ) { /** * Wrap add to cart link in container. * * @param string $html Add to cart link HTML. * @return string Add to cart link HTML. */ function understrap_loop_add_to_cart_link( $html ) { return '
' . $html . '
'; } } if ( ! function_exists( 'understrap_loop_add_to_cart_args' ) ) { /** * Add Bootstrap button classes to add to cart link. * * @param array $args Array of add to cart link arguments. * @return array Array of add to cart link arguments. */ function understrap_loop_add_to_cart_args( $args ) { if ( isset( $args['class'] ) && ! empty( $args['class'] ) ) { if ( ! is_string( $args['class'] ) ) { return $args; } // Remove the `button` class if it exists. if ( false !== strpos( $args['class'], 'button' ) ) { $args['class'] = explode( ' ', $args['class'] ); $args['class'] = array_diff( $args['class'], array( 'button' ) ); $args['class'] = implode( ' ', $args['class'] ); } $args['class'] .= ' btn btn-outline-primary'; } else { $args['class'] = 'btn btn-outline-primary'; } if ( 'bootstrap4' === get_theme_mod( 'understrap_bootstrap_version', 'bootstrap4' ) ) { $args['class'] .= ' btn-block'; } return $args; } } if ( ! function_exists( 'understrap_account_menu_item_classes' ) ) { /** * Add Bootstrap classes to the account navigation. * * @param string[] $classes Array of classes added to the account menu items. * @return string[] Array of classes added to the account menu items. */ function understrap_account_menu_item_classes( $classes ) { $classes[] = 'list-group-item'; $classes[] = 'list-group-item-action'; if ( in_array( 'is-active', $classes, true ) ) { $classes[] = 'active'; } return $classes; } }