derrida
asked on
How can i change classes on woocommerce buttons with filter hooks
hi
all i need is the change the classes on the woocommerce buttons, for example the add to cart button. i want to do it with filter functions.
i have searched and found overriding css, i want to use the filter functions to do it, i assume one can use str_replace, but not sure how exactly.
best regards
all i need is the change the classes on the woocommerce buttons, for example the add to cart button. i want to do it with filter functions.
i have searched and found overriding css, i want to use the filter functions to do it, i assume one can use str_replace, but not sure how exactly.
best regards
ASKER
well i managed to change classes to buttons in the loop but cannot find what i need to hook to for the single product add to cart button:
any idea?
by the way, this is the first time i post a question and get no responses at all, not even asking for clarifications.
add_filter( 'woocommerce_loop_add_to_cart_args','boottheme_change_loop_buttons_classes' );
function boottheme_change_loop_buttons_classes( $button ) {
$button['class'] = str_replace('button','waves-effect waves-light btn',$button['class']);
return $button;
}
any idea?
by the way, this is the first time i post a question and get no responses at all, not even asking for clarifications.
Why not just override it in CSS?
ASKER
hey julian
because i am using materialize and instead of recreating a look i can just give the right classes. so the look is consistent and actually easier to change.
because i am using materialize and instead of recreating a look i can just give the right classes. so the look is consistent and actually easier to change.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
ASKER