lundi 9 novembre 2020

Validate get_tax_totals in checkout

I am trying to add an if statement to reflect a text when the tax = 0. I took the template from cart/review-order from line :93:

        <tr class="tax-total">
            <th><?php if( WC()->cart->get_tax_totals() == 0 ){ echo 'Vat reverse (0%)'; } else { echo esc_html( WC()->countries->tax_or_vat() ); } ?></th>
            <td><?php wc_cart_totals_taxes_total_html(); ?></td>
        </tr>

I added <?php if( WC()->cart->get_tax_totals() == 0 ){ echo 'Vat reverse (0%)'; } else { echo esc_html( WC()->countries->tax_or_vat() ); } ?> but it skips the if() and shows in all situations the else statement. I have tried different ways to get the tax totals, but all in the same result. What goes wrong here?

Aucun commentaire:

Enregistrer un commentaire