Woocommerce Shop Logo - Ecommerce Platform

Web Design SOLVED: Woocommerce 2.3.8 Double/Duplicated Totals Problem

After updating Woocommerce to v2.3.8 many sites seem to be running into a common problem:

The cart totals are duplicated twice on the basket/cart page, resulting in the following problem:

woocommerce-2.3.8-duplicated-totals-problem

Without getting technical, the problem is caused by the changes between Woocommerce 2.3.7 & 2.3.8, but it is easily fixed.

The chances are that your WordPress theme is using some override templates which are now ‘out of date’.

Open up either your filemanager in cPanel or your favourite FTP client (Filezilla/YummyFTP etc) and find your theme’s folder.

If you’re not familiar with the WordPress file structure, this can be found in the folder named ‘wp-content’, and then the subfolder ‘themes’:

public_html/wp-content/themes/<your theme folder>

Inside your themes folder, you should find another subfolder named ‘woocommerce’, and you then need to find the sub-sub-folder called ‘cart’:

public_html/wp-content/themes/<your theme folder>/woocommerce/cart/

You then need to find the file called ‘cart.php’ and open it up in your favourite text editor (in the screenshot below, I’m just using Adobe Dreamweaver) where you’re looking for the following line of code:

woocommerce_cart_totals();

which will likely be toward the end of the file:

cart-code-screenshot

In the above example, it’s on line 143.

You now have two options:

  • Delete that line completely
  • ‘Comment out’ the line with ‘//’ (shown in the next image)

Line Commented out:

cart-code-screenshot-commented

Then, just save your file and your problem should be solved! 🙂

NOTE: If you’re using a child-theme, all of the above applies to the child-theme folders too.

Comments 23

  1. Worked for me. It’s only displaying one sum on their. But same is the problem with checkout page with paypal payment

    1. Post
      Author
    1. Post
      Author
  2. Your theme will have the cart/cart.php overwritten in the woocommerce folder of your (child) theme. In there, you will find this line (or at least something similar calling that same function):

    You need to remove this line from your overwritten template file and your cart totals should only appear once.

  3. Brother, I manage this website through the WP dashboard and don’t know how to get into C Panel.

    Is it possible to fix this issue without going to the C Panel / without programming?

    thanks,
    Sulaiman.

    1. Post
      Author

      Not really. However, the current versions of WC shouldn’t have this problem anymore; this is quite an old problem now. Either way, to get access to your cPanel & FTP etc just ask your hosting provider…

  4. I can only find a cart.php file in /wp-content/plugins/woocommerce/templates/cart/
    But it does not have woocommerce_cart_totals(); in the code.

    I also searched through all other possible files but cannot find it anywhere?

    1. Post
      Author

      You’re probably using a newer version of Woocommerce where this problem has since been resolved without the workaround I outlined above.

      In later updates, they moved this functionality into the woocommerce_cart_collaterals function. If you’re having problems, it could be that your theme is out of date?

      1. I’m having the same double cart totals problem, and I do not have that line of text in cart.php. My theme and Woocommerce installations are up-to-date and I still see two cart totals… Don’t know what to do. 🙁

        1. Post
          Author

          You may have a different version of Woocommerce installed (probably a newer version – 2.3.8 is quite old now) so it may not be the same; which version are you using?

    1. Post
      Author
  5. Hi Simon, thanks. It works now.
    But still weird. Because I was using the latest version of Woocommerce, after I just updated ones more it worked. :-s

    Anyway its working, thanks a lot.

    1. Post
      Author

      No worries 🙂 I was recently going to stop comments on this post, but people still seem to be running into the problem. Glad it’s sorted! 🙂

    1. Post
      Author

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.