From 61dbdfcde33f6f8fa732680cae13b38eec773172 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 23 Mar 2018 13:53:48 -0600 Subject: [PATCH] Replace add-to-cart template with function - Remove add-to-cart template; - Add function to replace "button" class with "btn btn-outline-primary; --- inc/woocommerce.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 098a60b..17da035 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -132,3 +132,12 @@ function understrap_wc_form_field_args( $args, $key, $value = null ) { 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; +}