Automattic\WooCommerce\Internal\Features
FeaturesController::flag_abandoned_cart_recovery_enabled_notice
Flag a one-shot transient when the merchant turns on Abandoned cart recovery.
change_feature_enable fires this action mid-request before the post-save redirect, so the actual notice has to render on the next page load. We stash a transient here and maybe_render_abandoned_cart_recovery_enabled_notice picks it up the next time woocommerce_settings_advanced fires.
Method of the class: FeaturesController{}
No Hooks.
Returns
null. Nothing (null).
Usage
$FeaturesController = new FeaturesController(); $FeaturesController->flag_abandoned_cart_recovery_enabled_notice( $feature_id, $is_enabled ): void;
- $feature_id(string) (required)
- Feature being toggled.
- $is_enabled(true|false) (required)
- True when turned on, false when turned off.
FeaturesController::flag_abandoned_cart_recovery_enabled_notice() FeaturesController::flag abandoned cart recovery enabled notice code WC 11.1.1
public function flag_abandoned_cart_recovery_enabled_notice( $feature_id, $is_enabled ): void {
if ( 'abandoned_cart_recovery' === $feature_id && $is_enabled ) {
set_transient( 'wc_abandoned_cart_recovery_enabled_notice', 'yes', MINUTE_IN_SECONDS );
}
}