Answer the question
In order to leave comments, you need to log in
How to override WooCommerce cart widget template?
Trying to override the cart widget template to edit it.
I do this:
1. I copied the mini-cart.php file to my_theme/woocommerce/cart folder, made changes
2. I added the following code to functions.php:
if(!function_exists('woocommerce_mini_cart')) {
function woocommerce_mini_cart($args = array()) {
$defaults = array(
'list_class' => ''
);
$args = wp_parse_args($args, $defaults);
wc_get_template(get_stylesheet_directory_uri() . '/woocommerce/cart/mini-cart.php', $args);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question