Merge pull request #5572 from justinstern/master

Check for Existence of Cart Before Using
This commit is contained in:
Mike Jolley 2014-05-29 16:33:33 +01:00
commit 4c0e7a13f7
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
public function is_available() {
$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;
}