Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ginsterbusch/6eaf41835262c838f952dce7535b03ad to your computer and use it in GitHub Desktop.
Save ginsterbusch/6eaf41835262c838f952dce7535b03ad to your computer and use it in GitHub Desktop.
Most useless incremental count ever ..
<?php
/**
* When looking into how to properly and useful reorder the total / subtotal sum in the Invoice PDF which is generated by Germanized for WooCommerce, I stumbled upon this .. gem .. o.O
* I'd call it one of the most useless incremental counts I've ever seen so far.
* @file woocommerce-germanized-pro/templates/invoives/table-gross.php
*
*/
?>
<?php if ( $order_totals = $invoice->get_totals() ) : $i = 0; ?>
<?php foreach ( $order_totals as $total ) : $i++; ?>
<tr class="footer <?php echo ( isset( $total[ 'classes' ] ) ? implode( ' ', $total[ 'classes' ] ) : "" ); ?>">
<th class="td" scope="row" colspan="3">Label: <?php echo $total['label']; ?></th>
<td class="td"><?php echo $total['value']; ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
@ginsterbusch
Copy link
Author

ginsterbusch commented Jul 18, 2020

post scriptum: Its not being used in the template. At all. Counting for the heck of it? o.O

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment