' . sprintf( _n( 'You have %s item in your cart', 'You have %s items in your cart', $woocommerce->cart->cart_contents_count, 'evolve' ), $woocommerce->cart->cart_contents_count ) . '
cart->get_cross_sells();
if ( sizeof( $crosssells ) == 0 ) {
return;
}
$number_of_columns = 4;
woocommerce_cross_sell_display( apply_filters( 'woocommerce_cross_sells_total', - 1 ), $number_of_columns );
}
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
/*
Add Bootstrap Style To The WooCommerce Fields
======================================= */
add_filter( 'woocommerce_form_field_args', 'evolve_wc_form_field_args', 10, 3 );
function evolve_wc_form_field_args( $args, $key, $value = null ) {
// Start field type switch case
switch ( $args['type'] ) {
case 'select' : /* Targets all select input type elements, except the country and state select input types */
$args['class'][] = 'form-group'; // Add a class to the field's html element wrapper - woocommerce input types (fields) are often wrapped within a tag
$args['input_class'] = array( 'form-control' ); // Add a class to the form input itself
//$args['custom_attributes']['data-plugin'] = 'select2';
$args['label_class'] = array( 'col-sm-4 col-form-label' );
$args['custom_attributes'] = array(
'data-plugin' => 'select2',
'data-allow-clear' => 'true',
'aria-hidden' => 'true',
); // Add custom data attributes to the form input itself
break;
case 'country' : /* By default WooCommerce will populate a select with the country names - $args defined for this specific input type targets only the country select element */
$args['class'][] = 'form-group single-country';
$args['label_class'] = array( 'col-sm-4 col-form-label' );
break;
case 'state' : /* By default WooCommerce will populate a select with state names - $args defined for this specific input type targets only the country select element */
$args['class'][] = 'form-group'; // Add class to the field's html element wrapper
$args['input_class'] = array( 'form-control' ); // add class to the form input itself
//$args['custom_attributes']['data-plugin'] = 'select2';
$args['label_class'] = array( 'col-sm-4 col-form-label' );
$args['custom_attributes'] = array(
'data-plugin' => 'select2',
'data-allow-clear' => 'true',
'aria-hidden' => 'true',
);
break;
case 'text':
case 'password':
case 'datetime':
case 'datetime-local':
case 'date':
case 'month':
case 'time':
case 'week':
case 'number':
case 'email':
case 'url':
case 'tel':
$args['class'][] = 'form-group';
$args['input_class'] = array( 'form-control' );
$args['label_class'] = array( 'col-sm-4 col-form-label' );
break;
case 'textarea' :
$args['input_class'] = array( 'form-control' );
$args['label_class'] = array( 'col-sm-4 col-form-label' );
break;
case 'checkbox' :
$args['class'][] = 'custom-control custom-checkbox';
$args['input_class'] = array( 'custom-control-input' );
$args['label_class'] = array( 'custom-control-label' );
break;
case 'radio' :
$args['class'][] = 'custom-control custom-radio';
$args['input_class'] = array( 'custom-control-input' );
$args['label_class'] = array( 'custom-control-label' );
break;
default :
$args['class'][] = 'form-group';
$args['input_class'] = array( 'form-control' );
$args['label_class'] = array( 'col-sm-4 col-form-label' );
break;
}
return $args;
}
$evolve_woocommerce_option = get_option( 'evl_options' );
$evolve_woocommerce_one_page_checkout = isset( $evolve_woocommerce_option['evl_evolve_woocommerce_one_page_checkout'] ) ? $evolve_woocommerce_option['evl_evolve_woocommerce_one_page_checkout'] : '';
if ( $evolve_woocommerce_one_page_checkout != '1' ) {
add_action( 'woocommerce_before_checkout_form', 'evolve_woocommerce_before_checkout_form' );
}
function evolve_woocommerce_before_checkout_form( $args ) {
global $woocommerce;
?>