• Resolved bestbuds519

    (@bestbuds519)


    Hi I am using the Pro Version and would like to know if it is possible to edit what is shown when using the short code {email_order_total_footer}. Or if another short code can be used in its place. The current short code pulls this:

    Subtotal:
    $40
    
    Delivery:
    $15 via Delivery
    
    Payment method:
    Cash on delivery
    
    Total:
    $55

    I am trying to only have it display this:

    Subtotal:
    $40
    
    Delivery:
    $15 
    
    Total:
    $55

    Is this at all possible?

    • This topic was modified 5 years, 1 month ago by bestbuds519.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Georgi Bakalski

    (@irdroid)

    Hi,

    yes it is possible by editing the file /plugins/woo-instant-notifications/admin/class-wcnotifications-instance.php and adding the following indicated with + (Note that + shall be removed after editing the file )to the following function:

    function email_order_total_footer() {
                            ob_start();
                            if ( $totals = $this->object->get_order_item_totals() ) {
                                    $i = 0;
                                    foreach ( $totals as $total ) {
                                            write_log($total['label']);
    +                                        if($total['label']!= "Payment method:"){
                                            $i ++;
                                            ?>
                                            <tr>
                                            <th scope='row' colspan='2'
                                                style='text-align:left; border: 1px solid #eee; <?php echo 1 == $i ? 'border-top-width: 4px;' : ''; ?>'><?php echo $total['label']; ?></th>
                                            <td style='text-align:left; border: 1px solid #eee; <?php echo 1 == $i ? 'border-top-width: 4px;' : ''; ?>'><?php echo $total['value']; ?></td>
                                            </tr><?php
                                    }
    +                                }
                            }
    Thread Starter bestbuds519

    (@bestbuds519)

    I noticed that this piece of coding *write_log($total[‘label’]);* is not in my original line of coding and does not have a + sign indicating that I need to add it.

    Do I have to add this line as well? Or disregard that it is not there and just add the two lines that you indicated above.

    Thank you for your help!

    • This reply was modified 5 years, 1 month ago by bestbuds519.
    • This reply was modified 5 years, 1 month ago by bestbuds519.
    Plugin Author Georgi Bakalski

    (@irdroid)

    No, the line isn’t needed

    Thread Starter bestbuds519

    (@bestbuds519)

    Awesome thank you so much for the help!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Receipt Help’ is closed to new replies.