• Resolved eladvider

    (@eladvider)


    Hi,
    i’m trying to display the cart total in the cart popup.
    Also im using wc_cart_totals_order_total_html() function.
    i noticed that the result is 0.

    after digging this issue i saw that when im adding products to cart, calculate_totals() function is called but it not calculate the total because this line:

    // Only calculate the grand total + shipping if on the cart/checkout
    if ( is_checkout() || is_cart() || defined( ‘WOOCOMMERCE_CHECKOUT’ ) || defined( ‘WOOCOMMERCE_CART’ ) ) {

    what i do is define WOOCOMMERCE_CHECKOUT to true.

    its ok? and why this conditon need for?

    Thanks

The topic ‘Get cart total return 0’ is closed to new replies.