I am trying to override mini-cart.php which is template file located at woocommerce/cart/mini-cart.php. It should override behaviour of woocommerce widget cart but it isnt working. I can make any changes to the file but it looks like it is still loading from some other place and it is not overriden. I have also tried modifying core template files of woocommerce and deleting mini-cart.php from it but widget is still working. However mini-cart.php structure looks exactly the same as html structure generated in final. But it looks like woocommerce isnt using this file so it has probably changed by some update and mini-cart.php is just remain from later versions. Any ideas what file should I override to change look of widget cart?

I dont want to completely override whole core widget cart class because I just want to change one <span> to <p>.

Thanks in forward

  • 3
    Add and remove an item, this will force the cart to purge it's html – Andrew Lazarus May 27 '15 at 9:12
  • @Andrew I can verify either adding or removing something from cart seems to clear whatever cache is preventing it from updating with FTP'ng the mini-cart.php override to the theme folder. Thanks! – OG Sean Mar 27 '20 at 2:15

Have you made sure to copy the mini-cart.php into yourtheme/woocommerce/cart/ not just yourtheme/woocommerce I can say for certain this works in Woocommerce version 2.0.12

Also if your saying that editing the core file isn't working is it possible that its getting override some where else in your theme. Could be worth searching your theme directory code for woocommerce_before_mini_cart seeing if thats used some where else.

  • my mini-cart.php is located in woocommerce/cart/ and I dont have any other files with woocommerce_before_mini_cart – horin Jul 30 '13 at 8:50
  • What version of woo are you using? And what theme, if not custom? – Mark Davidson Jul 30 '13 at 8:51
  • woo 2.0.1 and custom theme. Overriding every other theme files works great ... only mini-cart doesnt work – horin Jul 30 '13 at 8:53
  • One suggestion if not to much of a pain. Could you try changing themes to say Twenty Twelve and trying the override with that theme. Also try upgrading woo just eliminate the most obvious things. Seems incredibly strange that even editing the mini-cart.php in the woocommerce plugin does not work. Not possible you have another plugin thats being used for the cart ( know its probably not but worth a thought ). – Mark Davidson Jul 30 '13 at 8:59
  • 1
    I changed theme to twenty eleven and it worked here so I changed it back to my custom theme and now it is working in it too. It's strange. Probably some sort of bug. Anyway, it is working now. Thanks for suggestion about changing theme – horin Jul 30 '13 at 9:03

I had this same problem. You must clear cache (or just delete cookies) before you will see your override. Not sure why :)

  • 17
    +1 -- the WooCommerce cart is saved in sessionStorage to avoid pulling a new copy on every page, so you need to clear your browser's sessionStorage to see any changes -- or just add another item to the cart, and it will be replaced. [and to the person who downvoted this: you get my downvote!] – webaware Dec 7 '13 at 21:45
  • Just add/remove something from cart and it will clear the cached mini cart and you will see the updated mini-cart.php changes then – OG Sean Mar 27 '20 at 2:16

As Mark Davidson said to over ride mini-cart.php you need to place it in a file that you have to name in your theme

yourtheme / woocommerce / cart / mini-cart.php

But you have to remember that for changes to take effect you need to go back into the widgets page of wp-admin and re-save the shopping cart widget each time you make a change or they will not show up.

  • Just add/remove something from cart and it will clear the cached mini cart and you will see the updated mini-cart.php changes then – OG Sean Mar 27 '20 at 2:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.