• Resolved jazzu

    (@jazzu)


    Hello!

    I’d like to send some additional info when Direct Bank Transfer payment method is selected. I already have the customer-on-hold-order.php in my child theme.

    I added the code below, but I’d only like it to be actually sent to the customer ONLY when they choose direct bank transfer payment method.

    <p><?php echo ("Če ste za način plačila uporabili neposredno bančno transakcijo, lahko podatke za plačilo vidite spodaj."); ?></p>
    <p><?php esc_html_e( 'Za referenco (sklic) uporabite: SI 00 ' . $order->get_order_number() , 'woocommerce' ); ?></p>

    What would be the best approach to this?

    Kind regards

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Paulo P – a11n

    (@paulostp)

    Hello,

    Thanks for reaching out!

    Code customization is outside the scope of support we can provide, but I found this Stack Overflow link that might point you in the right direction: https://stackoverflow.com/questions/53361845/stop-specific-customer-email-notification-based-on-payment-methods-in-woocommerc

    Hope this helps!

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.

    Thread Starter jazzu

    (@jazzu)

    Hi @paulostp !

    Sorry, I didn’t see the email notification.

    Thank you for the link, but I’m not good with php… I currently edited it, so currently it looks like this:

    add_filter( 'woocommerce_email_recipient_customer_on_hold_order', 'customer_on_hold_order_for_bacs', 10, 2 );
    	function customer_on_hold_order_for_bacs( $recipient, $order ) {
    
        if( is_a('WC_Order', $order) && $order->get_payment_method() !== 'bacs' ) {
    		do_action( 'woocommerce_email_header', $email_heading, $email ); ?> {
            <p><?php echo ("test."); ?></p>
        }
    }
      <? return $recipient;
    }

    But obviously it’s not working. I don’t have any idea what I did wrong with this.

    Kind regards

    Hi @jazzu

    it’s not working

    Sorry to hear that.

    Kindly be informed that support for custom coding is beyond the scope of support we are able to provide in this forum. This particular forum is for questions that are related to the WooCommerce core features.

    For help with custom code I recommend the WooCommerce Developer Resources Portal.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Lastly, for direct assistance with code customizations, I recommend consulting with the WooCommerce Customizations Partners. https://woocommerce.com/customizations/

    Cheers

    This thread has been inactive for a bit, so I’m going to mark it as closed.

    Please feel free to open a new thread if you have any further questions.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display some info only when specific payment method is chosen’ is closed to new replies.