Fix WooCommerce block's checkout error when opt-in is disabled
When opt-in is disabled it fails to validate checkout data, because it expects mailpoet.optin to present. This PRs skips extending checkout data schema in case the opt-in is disabled. [MAILPOET-4004]
This commit is contained in:
committed by
Veljko V
parent
93cfc4d251
commit
1bc968e55f
@@ -83,6 +83,9 @@ class WooCommerceBlocksIntegration {
|
||||
}
|
||||
|
||||
public function extendRestApi() {
|
||||
if (!$this->settings->get('woocommerce.optin_on_checkout.enabled', false)) {
|
||||
return;
|
||||
}
|
||||
$extend = Package::container()->get(ExtendRestApi::class);
|
||||
$extend->register_endpoint_data(
|
||||
[
|
||||
|
Reference in New Issue
Block a user