1
votes

I need assistance with customizing a woocommerce thankyou.php file and new-order.php file.

I want to show an image before a zapper gateway instructions on the thank you email and also show it on the email sent to client for payment.

I have the image showing problem in the thankyou.php page but its also showing on all payment gateways not only on the zapper gateway and its not showing on the new-order email sent to client.

here is the code for the thankyou.php

<?php if ( $order->get_payment_method_title() === 'zapper' ); ?> <div class="zapper"> <?php echo '<p style="margin-top:0;"><img src="webiste.com/wp-content/uploads/2017/10/zapper-process.j‌​pg"; /></p>'; ?>

Regards Bongani

1
We can assist you once you post an attempt at coding a solution. - Andrew Schultz
Hi @AndrewSchultz , here is the code for the thankyou.php '<?php if ( $order->get_payment_method_title() === 'zapper' ); ?> <div class="zapper"> <?php echo '<p style="margin-top:0;"><img src="webiste.com/wp-content/uploads/2017/10/zapper-process.jpg" /></p>'; ?>' - Bongani Dlamini
Put it in your question not the comments. - Andrew Schultz
@AndrewSchultz , its added - Bongani Dlamini

1 Answers

0
votes

You can use a specific hook for your payment gateway woocommerce_thankyou_{payment gateway}.

add_action( 'woocommerce_thankyou_zapper', 'message_for_zapper', 5 );

function message_for_zapper( $order_id ) {

    echo '<div class="zapper"><p style="margin-top:0;"><img src="webiste.com/wp-content/uploads/2017/10/zapper-process.j‌​pg" /></p>';

}

More examples here https://rudrastyh.com/woocommerce/thank-you-page.html#add_form