Title: cart-empty function location?
Last modified: September 1, 2016

---

# cart-empty function location?

 *  Resolved [jordanwebdev](https://wordpress.org/support/users/jordanwebdev/)
 * (@jordanwebdev)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/cart-empty-function-location/)
 * I’m trying to modify the text of the “Return To Shop” button when the cart is
   empty. I know I can just override the cart-empty.php template file, but I think
   it’s best to just override the original function in my functions.php, just in
   case WooCommerce updates the template file (is this the right reasoning?)
 * Anyway, I can’t find the function that serves up the cart-empty.php file. Could
   someone please let me know what it is, and better yet, a strategy to find it 
   on my own next time?
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [9 years, 11 months ago](https://wordpress.org/support/topic/cart-empty-function-location/#post-7503300)
 * While it is best to avoid overriding templates when possible, overriding the 
   function and just redirecting to a different / custom template is basically the
   same thing.
 * So you might as well override the template in your theme: [http://docs.woothemes.com/document/template-structure/](http://docs.woothemes.com/document/template-structure/)
 * Alternatively, you could use a plugin like this to translate the text string:
   [https://wordpress.org/plugins/loco-translate/](https://wordpress.org/plugins/loco-translate/),
   or write a custom snippet to change the text: [http://speakinginbytes.com/2013/10/gettext-filter-wordpress/](http://speakinginbytes.com/2013/10/gettext-filter-wordpress/)
 *  Thread Starter [jordanwebdev](https://wordpress.org/support/users/jordanwebdev/)
 * (@jordanwebdev)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/cart-empty-function-location/#post-7503423)
 * Thanks, that filter seems very useful!
 * I’m finding, though, that there are a lot of changes I need to make to template
   files in order to get the site looking exactly like it needs to be. The issue,
   then, is when WooCommerce updates template files, the client sees that WooCommerce
   is out of date, and rightfully so will want to update the plugin.
 * Just recently I noticed I had to update some template files due to a WooCommerce
   plugin update. Note that I did not modify the plugin directly, but instead copied
   the template files over to my theme and overrode them. Still, I had an issue 
   where the review starts were displaying beside each other (looking like 10 stars
   rather than 5, ha!). For me I believe it was just a simple fix of updating the
   version numbers in my theme, and maybe deleting one template, but I don’t want
   a client to have to deal with this.
 * What is the best practise so clients don’t have to worry about these things? 
   I’d hate for them to just not update and then they get hacked due to a security
   vulnerability…
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/cart-empty-function-location/#post-7503441)
 * There is not way around that; if you change tempaltes, you need to test them 
   with updates and bump the versions. As the disclaimer per file states:
 * >  * This template can be overridden by copying it to yourtheme/woocommerce/x
   > **
   > HOWEVER, on occasion WooCommerce will need to update template files and you*(
   > the theme developer) will need to copy the new files to your theme to * maintain
   > compatibility. We try to do this as little as possible, but it does * happen.
   > When this occurs the version of the template file will be bumped and * the 
   > readme will list any important changes.
 *  Thread Starter [jordanwebdev](https://wordpress.org/support/users/jordanwebdev/)
 * (@jordanwebdev)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/cart-empty-function-location/#post-7503447)
 * Okay, well at least I know I’ve been doing things right. On one hand it means
   inconvenience for the client, on the other, maybe it means more money for us 
   if they have us fix the issue for them, lol.
 * By the way, I think WooCommerce is amazing. I was completely surprised by just
   how much it does out of the box. Nice job!
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/cart-empty-function-location/#post-7503450)
 * Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘cart-empty function location?’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [cart](https://wordpress.org/support/topic-tag/cart/)
 * [empty](https://wordpress.org/support/topic-tag/empty/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [text](https://wordpress.org/support/topic-tag/text/)

 * 5 replies
 * 3 participants
 * Last reply from: [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/cart-empty-function-location/#post-7503450)
 * Status: resolved