array( 'name' => __( 'Alice Chatbot Key', 'alice-chatbot' ), 'type' => 'title', 'desc' => '', 'id' => 'xl_settings_tab_alice_section_title' ), 'title' => array( 'name' => __( 'Plugin Key', 'alice-chatbot' ), 'type' => 'text', 'desc' => __( 'Please enter the plugin key to verify the plugin and your website.', 'alice-chatbot' ), 'id' => 'xl_settings_tab_alice_plugin_key' ), 'section_end' => array( 'type' => 'sectionend', 'id' => 'xl_settings_tab_alice_section_end' ) ); return apply_filters( 'wc_settings_tab_alice_settings', $settings ); } } WC_Settings_Tab_Alice::init(); // Insert JS code in Footer function xl_alice_javascript_footer() { $xl_settings_tab_alice_plugin_key = get_option( 'xl_settings_tab_alice_plugin_key' ); $xl_api_url = 'https://live-v3.getalice.ai/api/ecommerce/plugins/connect-ecommerce-plugin?api_token='.$xl_settings_tab_alice_plugin_key.''; $response = wp_remote_post( $xl_api_url, array( 'method' => 'POST', 'timeout' => 45, 'cookies' => array() ) ); if ( is_wp_error( $response ) ) { $error_message = $response->get_error_message(); echo "Something went wrong: $error_message"; } else { $alice_admin_data = json_decode($response['body'], true); } ?>
To active Alice Chatbot, Please install and active Woocommerce.
'; }