Merge pull request #5572 from justinstern/master
Check for Existence of Cart Before Using
This commit is contained in:
commit
4c0e7a13f7
|
@ -104,7 +104,7 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
|
||||||
public function is_available() {
|
public function is_available() {
|
||||||
$is_available = ( 'yes' === $this->enabled ) ? true : false;
|
$is_available = ( 'yes' === $this->enabled ) ? true : false;
|
||||||
|
|
||||||
if ( 0 < $this->get_order_total() && $this->max_amount >= $this->get_order_total() ) {
|
if ( WC()->cart && 0 < $this->get_order_total() && $this->max_amount >= $this->get_order_total() ) {
|
||||||
$is_available = false;
|
$is_available = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue