Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I just installed woocommerce 2.0 (on Wordpress) on PHP 5.4, and I got this:

Strict Standards: Declaration of WC_Gateway_BACS::process_payment() should be compatible with WC_Payment_Gateway::process_payment() in D:mypathohtdocswordpresspluginswoocommerceclassesgatewaysacsclass-wc-gateway-bacs.php on line...

I check the files and found that WC_Payment_Gateway have no method process_payment(). I need to know how to resolve this (not by setting error_reporting()).

What is Strict Standards in PHP exactly?
In what condition so we get that error?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
389 views
Welcome To Ask or Share your Answers For Others

1 Answer

WC_Payment_Gateway is defined in abstract-wc-payment-gateway.php and declares a method

function process_payment() {}

while WC_Gateway_BACS defines it as

function process_payment( $order_id ) { ...

(maybe you mixed up WC_Payment_Gateway and WC_Payment_Gateways).

So, different signature (0 parameters vs 1 parameter) -> strict error.
Since it seems* to be used always with one parameter you could change

function process_payment() {}

to

function process_payment($order_id) {}

(*) keep in mind I know of woocommerce only since the last five minutes, so don't take my word for it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...