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:
parent
ae5790b844
commit
61dbdfcde3
|
@ -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;
|
||||
}
|
||||
|
|
Reference in New Issue