WordPress.org

Forums

Removing total from order-details.php in Woocommerce (4 posts)

  1. NeenNZ
    Member
    Posted 11 months ago #

    I have a client who wants to use Woocommerce just for ordering,
    shipping and payments will be added later.
    I have managed to pull the subtotal, shipping and payments from everything - EXCEPT order-details.php - so that subtotal and total still show on the my account, and after checkout.

    I can remove BOTH (by commenting out the below code, or have both showing. But I'm totally lost how to get just ONE of them.

    offending bit of code is:

    <?php
    if ( $totals = $order->get_order_item_totals() ) foreach ( $totals as $total ) :
    	?>
    	<tr>
    	<th scope="row"><?php echo $total['label']; ?></th>
    	<td><?php echo $total['value']; ?></td>
    	</tr>
    	<?php
    		endforeach;
    	?>

    Can anyone help with this? Totally lost as to how to do it.
    Thanks

  2. denizgezgin
    Member
    Posted 1 month ago #

    Hello,

    Have you been able to manage that? This is exactly the issue that I'm having; all the other files are ok, except "order-details.php".

    I'm trying to get rid of "subtotal" field, instead.

    Thanks,

    Deniz

  3. bazzer7rose
    Member
    Posted 2 weeks ago #

    Same issue, I want to change some of the static wording on this file and hide the bank info and I can't seem to find where this is pulling it from
    <?php
    if ( $totals = $order->get_order_item_totals() ) foreach ( $totals as $total ) :
    ?>
    <tr>
    <th scope="row"><?php echo $total['label']; ?></th>
    <td><?php echo $total['value']; ?></td>
    </tr>
    <?php
    endforeach;
    ?>

  4. NeenNZ
    Member
    Posted 2 weeks ago #

    Hi guys,
    It's been a while and I *did* get rid of it (kind of) - it was a pretty ugly solution from memory.

    I believe what I did in the end was make the row the subtotal was in 0 px high or something similar.

    I will see if I can dig up the code for it and double check.

    I know it had me tearing my hair out - it should be so simple! So obvious! It so isn't! :)

Reply

You must log in to post.

About this Topic