Skip to content

Commit 4416d0e

Browse files
make it possible to precheck woocommerce checkout block sign-up checkbox
1 parent 6f47505 commit 4416d0e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

integrations/woocommerce/class-woocommerce.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ public function add_hooks()
6868

6969
add_action('woocommerce_checkout_order_processed', array($this, 'subscribe_from_woocommerce_checkout'));
7070
add_action('woocommerce_store_api_checkout_order_processed', array($this, 'subscribe_from_woocommerce_checkout'));
71+
if ($this->options['precheck']) {
72+
add_filter("woocommerce_get_default_value_for_mc4wp/optin", function ($value) {
73+
return '1';
74+
});
75+
}
76+
7177
}
7278

7379
/**

0 commit comments

Comments
 (0)