• Resolved Web-Pepper

    (@pctevree)


    Hiya, at the bottom of the “Simple” template wich i added to my child theme, i see a “Subtotal” and an amount in euro’s, and below that is a “Total” (also with an amout in euro’s).

    Now i want to remove ONLY the “Subtotal” and an amount in euro’s.

    In the invoice.php i found these 2 lines:

    <th class="description"><?php echo $total['label']; ?></th>
    <td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td>

    .. but they seem to manage BOTH, so if i delete them both the subtotal AND the total are gone.

    How do i get this fixed to that the invoice is ONLY showing the total (with the amount in euro).

    In the screenshot i marked the area green, and the part to remove pink.

    Hope you can help!

Viewing 1 replies (of 1 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @pctevree,

    You do not need a PDF custom template to achieve what you described. My recommendation is to switch your template to our default Simple template, and add this code snippet to your site to remove the Subtotal line from the totals’ area:

    /**
     * PDF Invoices & Packing Slips for WooCommerce:
     * Remove the Subtotal line from the totals' area
     */
    add_filter( 'wpo_wcpdf_raw_order_totals', function( $item_totals, $order ) {
    	unset( $item_totals['cart_subtotal']);
    	return $item_totals;
    }, 10, 2 );

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

Viewing 1 replies (of 1 total)

The topic ‘Remove subtotal from custom PDF invoice’ is closed to new replies.