Plugin Contributor
kluver
(@kluver)
Hi @bestplaced,
You could create a custom template for your invoice and create a div around your whole document that has a class based on which payment method is being used.
Then based of that class you can show or hide certain elements with CSS in your document. For instance checking if the payment method is cash on delivery:
<?php $payment_method = $this->order->get_payment_method(); ?>
<div class="<?php echo $payment_method == 'cod' ? 'cod' : 'not-cod'; ?>">
//YOUR TEMPLATE HERE
</div>
I hope this helps!
-
This reply was modified 8 years ago by
kluver.
-
This reply was modified 8 years ago by
kluver.
Ok, sounds good. Thank you. Do you have any Idea where i can get/find the “codes” for the payments, like “cod”? Thanks
Plugin Contributor
Ewout
(@pomegranate)
Hi! These codes used to be listed in the WooCommerce settings, under “Checkout” (in the “Gateway ID” column), but WooCommerce changed that with the 3.4 update. If You have already updated to 3.4, the easiest place you can find this now is by checking the url of the settings page if you go to WooCommerce > Settings > Payments > [your payment method] and then check the “§ion=xxx” bit in the url (where xxx is your code).
Good luck!
Ewout
Works like a charm! Thank you!