RobBenz
RobBenz

Reputation: 609

<?php woocommerce_cart_totals(); ?> is somehow displaying twice

Woocommerce shopping cart page is acting very strange.

I just updated my theme ( X | Theme v3.2.5 ) and woocommerce ( v2.3.8 )

So I am running the most current versions.

For some reason, since the update my cart totals are now displaying twice on my cart page.

I have two subtotal columns, two proceed to checkout buttons, two empty cart buttons, etc.

When I look at the HTML, it's literally duplicated.

<div class="cart-collaterals">
 <div class="cart_totals ">
 <div class="cart_totals ">
</div>

Obviously cart_totals has more HTML underneath, but you get the idea.

On the actual cart.php page I can locate this php:

<?php woocommerce_cart_totals(); ?>

only one time. Here is all the markup from the cart.php page:

<div class="cart-collaterals">

    <?php do_action( 'woocommerce_cart_collaterals' ); ?>

    <?php woocommerce_cart_totals(); ?>

</div>

<?php do_action( 'woocommerce_after_cart' ); ?>

Is there any way to ensure that this php is only being ran one time?

I might try to just limit the height of the CSS container, but that's not the right fix...

Upvotes: 2

Views: 7855

Answers (2)

Dick Rundell
Dick Rundell

Reputation: 1

I had the same problem with TM Extra Options plugin on Themeforest. In the plugin remove <?php woocommerce_cart_totals(); ?> in the templates/cart/cart.php file (it's at the bottom) and you will remove duplicate "Cart Totals". Hope this helps someone.

Upvotes: 0

laurent
laurent

Reputation: 90736

In their latest update, they must have moved the cart total to the woocommerce_cart_collaterals, which means it is now printed once in this action, and once in your code.

Upvotes: 1

Related Questions