Replace add-to-cart template with function

- Remove add-to-cart template;
- Add function to replace "button" class with "btn btn-outline-primary;
This commit is contained in:
Unknown 2018-03-23 13:53:48 -06:00
parent ae5790b844
commit 61dbdfcde3
1 changed files with 9 additions and 0 deletions

View File

@ -132,3 +132,12 @@ function understrap_wc_form_field_args( $args, $key, $value = null ) {
return $args; return $args;
} }
/**
* Change loop add-to-cart button class to Bootstrap
*/
add_filter( 'woocommerce_loop_add_to_cart_args', 'understrap_woocommerce_add_to_cart_args', 10, 2 );
function understrap_woocommerce_add_to_cart_args( $args, $product ) {
$args['class'] = str_replace('button','btn btn-outline-primary', 'button');
return $args;
}