WooCommerce - Change Subtotal on Cart and Checkout - Hack The Tech - Latest News related to Computer and Technology

logo

Get Daily Latest News related to Computer and Technology and hack the world.

Sunday, August 6, 2023

demo-image

WooCommerce - Change Subtotal on Cart and Checkout

I would like to change the total in the cart and checkout, multiplying it by 10. (because it currently shows me the 10% deposit price - Woocommerce Deposite plugin -, but I would like to display the total price without deposit).

So I thought about multiplying that by 10.

8xH3p

I've created a copy of the cart-totals.php in my child theme. And I would like to modify this string of code to display the price multiplied by 10.

<tr class="cart-subtotal">
            <th><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></th>
            <td data-title="<?php esc_attr_e( 'Subtotal', 'woocommerce' ); ?>"><?php wc_cart_totals_subtotal_html(); ?></td>
        </tr>

So something like: <?php wc_cart_totals_subtotal_html(); ?> * 10 ----> 6100

Or if it's simpler, I'd like to add up the prices of the products on the left: 1500+4600 ---> 6100

How can I do that?



source https://stackoverflow.com/questions/76821095/woocommerce-change-subtotal-on-cart-and-checkout

No comments:

Post a Comment