Bas Elbers on "[Plugin: WooCommerce PDF Invoices] Paid Watermark Issues"

ساخت وبلاگ

akinleyeajayi
Member
Posted 1 month ago #

Even with the latest update 2.4.3 paid watermark isn't working for BACS when the order has been completed.

https://wordpress.org/plugins/woocommerce-pdf-invoices/

Bas Elbers
Member
Plugin Author

Posted 1 month ago #

This is by design. You can change this by adding a filter to your themes functions.php.

function exclude_payment_method_for_watermark($payment_methods, $order_id){
retu array();
}
add_filter('bewpi_paid_watermark_excluded_payment_methods', 'exclude_payment_method_for_watermark', 10, 1);

Didn't test code, but think it should work.

akinleyeajayi
Member
Posted 1 month ago #

I am delighted you responded but unfortunately i added the filter to my themes function.php but it still isn't working. Can you kindly advice how best to use the filter 'bewpi_paid_watermark_excluded_payment_methods' to make Paid Watermark work for BACS when i manually complete a order. Cheers.

Bas Elbers
Member
Plugin Author

Posted 1 month ago #

function exclude_payment_method_for_watermark($payment_methods, $order_id){
retu array();
}
add_filter('bewpi_paid_watermark_excluded_payment_methods', 'exclude_payment_method_for_watermark', 10, 2);

Try this one.

akinleyeajayi
Member
Posted 1 month ago #

Thanks once again. I have tried this one also but it isn't working also. I do not want to exclude BACS. What i am trying to do is to get the paid watermark on the invoice once i complete the order. Thank You Bas.

Bas Elbers
Member
Plugin Author

Posted 1 month ago #

Just a simple question to be sure..
Did you've Cancelled and Created the invoice again after you completed the order manually?

akinleyeajayi
Member
Posted 1 month ago #

Hello there, No i don't cancel and create. Once the order is made by a customer from the website and BACS payment method is selected at checkout. Once i receive the order i simply click on "Complete Order" once i receive payment however the "Complete Order Invoice' generated is still the same as when the order was placed and (On hold) as the Admin receives with in the Admin e-mail. All without Paid Watermark.

Bas Elbers
Member
Plugin Author

Posted 1 month ago #

And to which type of email did you attach (setting in 'General' settings tab) the invoice?
Will test the filters my self if I find the time! Busy as always. :)

akinleyeajayi
Member
Posted 1 month ago #

I understand lol. I use the domain e-mail. For testing i have disabled all payment methods and left just BACS. You can visit https://store.bellestoreinc.com/ and make a dummy purchase. I will complete the order so you can get the final invoice for a completed order. Thank You Bas.

Bas Elbers
Member
Plugin Author

Posted 1 month ago #

The filter is working, but the problem is that if you set the 'Attach to Email' to 'Processing Order' the invoice is already generated before you manually complete the order. When you complete the order, the already generated invoice is getting attached to the 'Completed Email'. You should set 'Attach to Email' to the 'Completed Order' email type and everything works as it should be.

Second option is to Cancel invoice before you complete the order. This way a new invoice will be generated.

akinleyeajayi
Member
Posted 1 month ago #

Hey Bas i guarantee you the e-mail setting is on "Complete Order" by default and it doesn't work. Cancelling and completing also does not work. I just tried both. Thank You.

Bas Elbers
Member
Plugin Author

Posted 1 month ago #

function exclude_payment_method_for_watermark($payment_methods, $order_id){
die('Function is working');
retu array();
}
add_filter('bewpi_paid_watermark_excluded_payment_methods', 'exclude_payment_method_for_watermark', 10, 2);

Try this to ensure the function is getting called. You've added the code to your functions.php of your theme right? Not from plugin itself?

It's strange..

Else please delete and install plugin again and try again.

akinleyeajayi
Member
Posted 1 month ago #

Adding this code result in White Screen of Death. Yes sure i added it to the Themes function.php

akinleyeajayi
Member
Posted 1 week ago #

Hello Bas, Still no resolution to this issue.

Bas Elbers
Member
Plugin Author

Posted 1 hour ago #

Please update to latest version and check the FAQ for the right filter. Let me know if it works.

akinleyeajayi
Member
Posted 57 minutes ago #

Thank you for the response. I have updated but still not working. Cheers

Bas Elbers
Member
Plugin Author

Posted 45 minutes ago #

Well, I have tested it my self. Added below code to functions.php of twentyfifteen theme and worked like a charm. Order status is completed and payment method is BACS, generated invoice and 'Paid' watermark was showing.

function bewpi_paid_watermark_excluded_payment_methods($payment_methods) { //retu array('bacs', 'cod', 'cheque', 'paypal'); retu array();
}
add_filter('bewpi_paid_watermark_excluded_payment_methods', 'bewpi_paid_watermark_excluded_payment_methods', 10, 2);

akinleyeajayi
Member
Posted 38 minutes ago #

Works like charm now. Finally. Thank you very much i am delighted.

Bas Elbers
Member
Plugin Author

Posted 11 minutes ago #

After all. Great!
I would be very delighted if you would rate the plugin. It would support future development a lot. Can you do that for me? :D

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 104 تاريخ : يکشنبه 29 فروردين 1395 ساعت: 23:37