mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Not display Button Gateway when only a free trial product is in cart
This commit is contained in:
parent
16ad84c244
commit
09149f1879
1 changed files with 15 additions and 0 deletions
|
@ -362,4 +362,19 @@ class CardButtonGateway extends \WC_Payment_Gateway {
|
|||
protected function settings_renderer(): SettingsRenderer {
|
||||
return $this->settings_renderer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the Gateway is available for use.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_available(): bool {
|
||||
$is_available = parent::is_available();
|
||||
|
||||
if ( $is_available && $this->is_free_trial_cart() ) {
|
||||
$is_available = false;
|
||||
}
|
||||
|
||||
return $is_available;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue