countries->get_base_country(); // https://developers.taxjar.com/api/reference/#countries . $tax_supported_countries = array_merge( array( 'US', 'CA', 'AU' ), KKART()->countries->get_european_union_countries() ); return in_array( $country_code, $tax_supported_countries, true ); } /** * Should we show the MailChimp install option? * True only if the user can install plugins. * * @deprecated 4.6.0 * @return boolean */ protected function should_show_mailchimp() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); return current_user_can( 'install_plugins' ); } /** * Should we show the Facebook install option? * True only if the user can install plugins, * and up until the end date of the recommendation. * * @deprecated 4.6.0 * @return boolean */ protected function should_show_facebook() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); return current_user_can( 'install_plugins' ); } /** * Is the Kkart Admin actively included in the Kkart core? * Based on presence of a basic KKART Admin function. * * @deprecated 4.6.0 * @return boolean */ protected function is_kkart_admin_active() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); return function_exists( 'kkart_admin_url' ); } /** * Should we show the Kkart Admin install option? * True only if the user can install plugins, * and is running the correct version of WordPress. * * @see KKART_Admin_Setup_Wizard::$kkart_admin_plugin_minimum_wordpress_version * * @deprecated 4.6.0 * @return boolean */ protected function should_show_kkart_admin() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $wordpress_minimum_met = version_compare( get_bloginfo( 'version' ), $this->kkart_admin_plugin_minimum_wordpress_version, '>=' ); return current_user_can( 'install_plugins' ) && $wordpress_minimum_met && ! $this->is_kkart_admin_active(); } /** * Should we show the new Kkart Admin onboarding experience? * * @deprecated 4.6.0 * @return boolean */ protected function should_show_kkart_admin_onboarding() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); // As of Kkart 4.1, all new sites should use the latest OBW from kkart-admin package. // This filter will allow for forcing the old wizard while we migrate e2e tests. return ! apply_filters( 'kkart_setup_wizard_force_legacy', false ); } /** * Should we display the 'Recommended' step? * True if at least one of the recommendations will be displayed. * * @deprecated 4.6.0 * @return boolean */ protected function should_show_recommended_step() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); return $this->should_show_theme() || $this->should_show_automated_tax() || $this->should_show_mailchimp() || $this->should_show_facebook() || $this->should_show_kkart_admin(); } /** * Register/enqueue scripts and styles for the Setup Wizard. * * Hooked onto 'admin_enqueue_scripts'. * * @deprecated 4.6.0 */ public function enqueue_scripts() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); } /** * Show the setup wizard. * * @deprecated 4.6.0 */ public function setup_wizard() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); if ( empty( $_GET['page'] ) || 'kkart-setup' !== $_GET['page'] ) { // WPCS: CSRF ok, input var ok. return; } $default_steps = array( 'new_onboarding' => array( 'name' => '', 'view' => array( $this, 'kkart_setup_new_onboarding' ), 'handler' => array( $this, 'kkart_setup_new_onboarding_save' ), ), 'store_setup' => array( 'name' => __( 'Store setup', 'kkart' ), 'view' => array( $this, 'kkart_setup_store_setup' ), 'handler' => array( $this, 'kkart_setup_store_setup_save' ), ), 'payment' => array( 'name' => __( 'Payment', 'kkart' ), 'view' => array( $this, 'kkart_setup_payment' ), 'handler' => array( $this, 'kkart_setup_payment_save' ), ), 'shipping' => array( 'name' => __( 'Shipping', 'kkart' ), 'view' => array( $this, 'kkart_setup_shipping' ), 'handler' => array( $this, 'kkart_setup_shipping_save' ), ), 'recommended' => array( 'name' => __( 'Recommended', 'kkart' ), 'view' => array( $this, 'kkart_setup_recommended' ), 'handler' => array( $this, 'kkart_setup_recommended_save' ), ), 'activate' => array( 'name' => __( 'Activate', 'kkart' ), 'view' => array( $this, 'kkart_setup_activate' ), 'handler' => array( $this, 'kkart_setup_activate_save' ), ), 'next_steps' => array( 'name' => __( 'Ready!', 'kkart' ), 'view' => array( $this, 'kkart_setup_ready' ), 'handler' => '', ), ); // Hide the new/improved onboarding experience screen if the user is not part of the a/b test. if ( ! $this->should_show_kkart_admin_onboarding() ) { unset( $default_steps['new_onboarding'] ); } // Hide recommended step if nothing is going to be shown there. if ( ! $this->should_show_recommended_step() ) { unset( $default_steps['recommended'] ); } // Hide shipping step if the store is selling digital products only. if ( 'virtual' === get_option( 'kkart_product_type' ) ) { unset( $default_steps['shipping'] ); } // Hide activate section when the user does not have capabilities to install plugins, think multiside admins not being a super admin. if ( ! current_user_can( 'install_plugins' ) ) { unset( $default_steps['activate'] ); } $this->steps = apply_filters( 'kkart_setup_wizard_steps', $default_steps ); $this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) ); // WPCS: CSRF ok, input var ok. // @codingStandardsIgnoreStart if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) { call_user_func( $this->steps[ $this->step ]['handler'], $this ); } // @codingStandardsIgnoreEnd ob_start(); $this->setup_wizard_header(); $this->setup_wizard_steps(); $this->setup_wizard_content(); $this->setup_wizard_footer(); exit; } /** * Get the URL for the next step's screen. * * @param string $step slug (default: current step). * @return string URL for next step if a next step exists. * Admin URL if it's the last step. * Empty string on failure. * * @deprecated 4.6.0 * @since 3.0.0 */ public function get_next_step_link( $step = '' ) { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); if ( ! $step ) { $step = $this->step; } $keys = array_keys( $this->steps ); if ( end( $keys ) === $step ) { return admin_url(); } $step_index = array_search( $step, $keys, true ); if ( false === $step_index ) { return ''; } return add_query_arg( 'step', $keys[ $step_index + 1 ], remove_query_arg( 'activate_error' ) ); } /** * Setup Wizard Header. * * @deprecated 4.6.0 */ public function setup_wizard_header() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); // same as default WP from wp-admin/admin-header.php. $wp_version_class = 'branch-' . str_replace( array( '.', ',' ), '-', floatval( get_bloginfo( 'version' ) ) ); set_current_screen(); ?> > <?php esc_html_e( 'Kkart › Setup Wizard', 'kkart' ); ?>

<?php esc_attr_e( 'Kkart', 'kkart' ); ?>

step; ?> steps; $selected_features = array_filter( $this->kkart_setup_activate_get_feature_list() ); // Hide the activate step if Jetpack is already active, unless Kkart Services // features are selected, or unless the Activate step was already taken. if ( class_exists( 'Jetpack' ) && Jetpack::is_active() && empty( $selected_features ) && 'yes' !== get_transient( 'kkart_setup_activated' ) ) { unset( $output_steps['activate'] ); } unset( $output_steps['new_onboarding'] ); ?>
    $step ) { $is_completed = array_search( $this->step, array_keys( $this->steps ), true ) > array_search( $step_key, array_keys( $this->steps ), true ); if ( $step_key === $this->step ) { ?>
'; if ( ! empty( $this->steps[ $this->step ]['view'] ) ) { call_user_func( $this->steps[ $this->step ]['view'], $this ); } echo ''; } /** * Display's a prompt for users to try out the new improved Kkart onboarding experience in Kkart Admin. * * @deprecated 4.6.0 */ public function kkart_setup_new_onboarding() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); ?>

<?php esc_attr_e( 'Kkart', 'kkart' ); ?>

is_kkart_admin_active() ) : ?>

countries->get_base_address(); $address_2 = KKART()->countries->get_base_address_2(); $city = KKART()->countries->get_base_city(); $state = KKART()->countries->get_base_state(); $country = KKART()->countries->get_base_country(); $postcode = KKART()->countries->get_base_postcode(); $currency = get_option( 'kkart_currency', 'GBP' ); $product_type = get_option( 'kkart_product_type', 'both' ); $sell_in_person = get_option( 'kkart_sell_in_person', 'none_selected' ); if ( empty( $country ) ) { $user_location = KKART_Geolocation::geolocate_ip(); $country = $user_location['country']; $state = $user_location['state']; } $locale_info = include KKART()->plugin_path() . '/i18n/locale-info.php'; $currency_by_country = wp_list_pluck( $locale_info, 'currency_code' ); ?>

/>
/> tracking_modal(); ?>

close_http_connection(); foreach ( $this->deferred_actions as $action ) { $action['func']( ...$action['args'] ); // Clear the background installation flag if this is a plugin. if ( isset( $action['func'][1] ) && 'background_installer' === $action['func'][1] && isset( $action['args'][0] ) ) { delete_option( 'kkart_setup_background_installing_' . $action['args'][0] ); } } } /** * Helper method to queue the background install of a plugin. * * @param string $plugin_id Plugin id used for background install. * @param array $plugin_info Plugin info array containing name and repo-slug, and optionally file if different from [repo-slug].php. * * @deprecated 4.6.0 */ protected function install_plugin( $plugin_id, $plugin_info ) { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); // Make sure we don't trigger multiple simultaneous installs. if ( get_option( 'kkart_setup_background_installing_' . $plugin_id ) ) { return; } $plugin_file = isset( $plugin_info['file'] ) ? $plugin_info['file'] : $plugin_info['repo-slug'] . '.php'; if ( is_plugin_active( $plugin_info['repo-slug'] . '/' . $plugin_file ) ) { return; } if ( empty( $this->deferred_actions ) ) { add_action( 'shutdown', array( $this, 'run_deferred_actions' ) ); } array_push( $this->deferred_actions, array( 'func' => array( 'KKART_Install', 'background_installer' ), 'args' => array( $plugin_id, $plugin_info ), ) ); // Set the background installation flag for this plugin. update_option( 'kkart_setup_background_installing_' . $plugin_id, true ); } /** * Helper method to queue the background install of a theme. * * @param string $theme_id Theme id used for background install. * * @deprecated 4.6.0 */ protected function install_theme( $theme_id ) { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); if ( empty( $this->deferred_actions ) ) { add_action( 'shutdown', array( $this, 'run_deferred_actions' ) ); } array_push( $this->deferred_actions, array( 'func' => array( 'KKART_Install', 'theme_background_installer' ), 'args' => array( $theme_id ), ) ); } /** * Helper method to install Jetpack. * * @deprecated 4.6.0 */ protected function install_jetpack() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $this->install_plugin( 'jetpack', array( 'name' => __( 'Jetpack', 'kkart' ), 'repo-slug' => 'jetpack', ) ); } /** * Helper method to install Kkart Services and its Jetpack dependency. * * @deprecated 4.6.0 */ protected function install_kkart_services() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $this->install_jetpack(); $this->install_plugin( 'kkart-services', array( 'name' => __( 'Kkart Services', 'kkart' ), 'repo-slug' => 'kkart-services', ) ); } /** * Retrieve info for missing Kkart Services and/or Jetpack plugin. * * @deprecated 4.6.0 * @return array */ protected function get_wcs_requisite_plugins() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $plugins = array(); if ( ! is_plugin_active( 'kkart-services/kkart-services.php' ) && ! get_option( 'kkart_setup_background_installing_kkart-services' ) ) { $plugins[] = array( 'name' => __( 'Kkart Services', 'kkart' ), 'slug' => 'kkart-services', ); } if ( ! is_plugin_active( 'jetpack/jetpack.php' ) && ! get_option( 'kkart_setup_background_installing_jetpack' ) ) { $plugins[] = array( 'name' => __( 'Jetpack', 'kkart' ), 'slug' => 'jetpack', ); } return $plugins; } /** * Plugin install info message markup with heading. * * @deprecated 4.6.0 */ public function plugin_install_info() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); ?> array( 'name' => __( 'Flat Rate', 'kkart' ), 'description' => __( 'Set a fixed price to cover shipping costs.', 'kkart' ), 'settings' => array( 'cost' => array( 'type' => 'text', 'default_value' => __( 'Cost', 'kkart' ), 'description' => __( 'What would you like to charge for flat rate shipping?', 'kkart' ), 'required' => true, ), ), ), 'free_shipping' => array( 'name' => __( 'Free Shipping', 'kkart' ), 'description' => __( "Don't charge for shipping.", 'kkart' ), ), ); return $shipping_methods; } /** * Render the available shipping methods for a given country code. * * @param string $country_code Country code. * @param string $currency_code Currency code. * @param string $input_prefix Input prefix. * * @deprecated 4.6.0 */ protected function shipping_method_selection_form( $country_code, $currency_code, $input_prefix ) { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $selected = 'flat_rate'; $shipping_methods = $this->get_wizard_shipping_methods( $country_code, $currency_code ); ?>
$method ) : ?>

$method ) : ?>
$setting ) : ?> />

countries->get_base_country(); $country_name = KKART()->countries->countries[ $country_code ]; $prefixed_country_name = KKART()->countries->estimated_for_prefix( $country_code ) . $country_name; $currency_code = get_kkart_currency(); $existing_zones = KKART_Shipping_Zones::get_zones(); $intro_text = ''; if ( empty( $existing_zones ) ) { $intro_text = sprintf( /* translators: %s: country name including the 'the' prefix if needed */ __( "We've created two Shipping Zones - for %s and for the rest of the world. Below you can set Flat Rate shipping costs for these Zones or offer Free Shipping.", 'kkart' ), $prefixed_country_name ); } $is_wcs_labels_supported = $this->is_wcs_shipping_labels_supported_country( $country_code ); $is_shipstation_supported = $this->is_shipstation_supported_country( $country_code ); ?>

get_product_weight_selection(), $this->get_product_dimension_selection() ), array( 'span' => array( 'class' => array(), ), 'select' => array( 'id' => array(), 'name' => array(), 'class' => array(), ), 'option' => array( 'value' => array(), 'selected' => array(), ), ) ); ?>

plugin_install_info(); ?>

user_email; return $user_email; } /** * Array of all possible "in cart" gateways that can be offered. * * @deprecated 4.6.0 * @return array */ protected function get_wizard_available_in_cart_payment_gateways() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $user_email = $this->get_current_user_email(); $stripe_description = '

' . sprintf( /* translators: %s: URL */ __( 'Accept debit and credit cards in 135+ currencies, methods such as Alipay, and one-touch checkout with Apple Pay. Learn more.', 'kkart' ), 'https://kkart.com/products/stripe/' ) . '

'; $paypal_checkout_description = '

' . sprintf( /* translators: %s: URL */ __( 'Safe and secure payments using credit cards or your customer\'s PayPal account. Learn more.', 'kkart' ), 'https://kkart.com/products/kkart-gateway-paypal-checkout/' ) . '

'; $klarna_checkout_description = '

' . sprintf( /* translators: %s: URL */ __( 'Full checkout experience with pay now, pay later and slice it. No credit card numbers, no passwords, no worries. Learn more about Klarna.', 'kkart' ), 'https://kkart.com/products/klarna-checkout/' ) . '

'; $klarna_payments_description = '

' . sprintf( /* translators: %s: URL */ __( 'Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries. Learn more about Klarna.', 'kkart' ), 'https://kkart.com/products/klarna-payments/ ' ) . '

'; $square_description = '

' . sprintf( /* translators: %s: URL */ __( 'Securely accept credit and debit cards with one low rate, no surprise fees (custom rates available). Sell online and in store and track sales and inventory in one place. Learn more about Square.', 'kkart' ), 'https://kkart.com/products/square/' ) . '

'; return array( 'stripe' => array( 'name' => __( 'Kkart Stripe Gateway', 'kkart' ), 'image' => KKART()->plugin_url() . '/assets/images/stripe.png', 'description' => $stripe_description, 'class' => 'checked stripe-logo', 'repo-slug' => 'kkart-gateway-stripe', 'settings' => array( 'create_account' => array( 'label' => __( 'Set up Stripe for me using this email:', 'kkart' ), 'type' => 'checkbox', 'value' => 'yes', 'default' => 'yes', 'placeholder' => '', 'required' => false, 'plugins' => $this->get_wcs_requisite_plugins(), ), 'email' => array( 'label' => __( 'Stripe email address:', 'kkart' ), 'type' => 'email', 'value' => $user_email, 'placeholder' => __( 'Stripe email address', 'kkart' ), 'required' => true, ), ), ), 'ppec_paypal' => array( 'name' => __( 'Kkart PayPal Checkout Gateway', 'kkart' ), 'image' => KKART()->plugin_url() . '/assets/images/paypal.png', 'description' => $paypal_checkout_description, 'enabled' => false, 'class' => 'checked paypal-logo', 'repo-slug' => 'kkart-gateway-paypal-express-checkout', 'settings' => array( 'reroute_requests' => array( 'label' => __( 'Set up PayPal for me using this email:', 'kkart' ), 'type' => 'checkbox', 'value' => 'yes', 'default' => 'yes', 'placeholder' => '', 'required' => false, 'plugins' => $this->get_wcs_requisite_plugins(), ), 'email' => array( 'label' => __( 'Direct payments to email address:', 'kkart' ), 'type' => 'email', 'value' => $user_email, 'placeholder' => __( 'Email address to receive payments', 'kkart' ), 'required' => true, ), ), ), 'paypal' => array( 'name' => __( 'PayPal Standard', 'kkart' ), 'description' => __( 'Accept payments via PayPal using account balance or credit card.', 'kkart' ), 'image' => '', 'settings' => array( 'email' => array( 'label' => __( 'PayPal email address:', 'kkart' ), 'type' => 'email', 'value' => $user_email, 'placeholder' => __( 'PayPal email address', 'kkart' ), 'required' => true, ), ), ), 'klarna_checkout' => array( 'name' => __( 'Klarna Checkout for Kkart', 'kkart' ), 'description' => $klarna_checkout_description, 'image' => KKART()->plugin_url() . '/assets/images/klarna-black.png', 'enabled' => true, 'class' => 'klarna-logo', 'repo-slug' => 'klarna-checkout-for-kkart', ), 'klarna_payments' => array( 'name' => __( 'Klarna Payments for Kkart', 'kkart' ), 'description' => $klarna_payments_description, 'image' => KKART()->plugin_url() . '/assets/images/klarna-black.png', 'enabled' => true, 'class' => 'klarna-logo', 'repo-slug' => 'klarna-payments-for-kkart', ), 'square' => array( 'name' => __( 'Kkart Square', 'kkart' ), 'description' => $square_description, 'image' => KKART()->plugin_url() . '/assets/images/square-black.png', 'class' => 'square-logo', 'enabled' => false, 'repo-slug' => 'kkart-square', ), 'eway' => array( 'name' => __( 'Kkart eWAY Gateway', 'kkart' ), 'description' => __( 'The eWAY extension for Kkart allows you to take credit card payments directly on your store without redirecting your customers to a third party site to make payment.', 'kkart' ), 'image' => KKART()->plugin_url() . '/assets/images/eway-logo.jpg', 'enabled' => false, 'class' => 'eway-logo', 'repo-slug' => 'kkart-gateway-eway', ), 'payfast' => array( 'name' => __( 'Kkart PayFast Gateway', 'kkart' ), 'description' => __( 'The PayFast extension for Kkart enables you to accept payments by Credit Card and EFT via one of South Africa’s most popular payment gateways. No setup fees or monthly subscription costs.', 'kkart' ), 'image' => KKART()->plugin_url() . '/assets/images/payfast.png', 'class' => 'payfast-logo', 'enabled' => false, 'repo-slug' => 'kkart-payfast-gateway', 'file' => 'gateway-payfast.php', ), ); } /** * Simple array of "in cart" gateways to show in wizard. * * @deprecated 4.6.0 * @return array */ public function get_wizard_in_cart_payment_gateways() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $gateways = $this->get_wizard_available_in_cart_payment_gateways(); $country = KKART()->countries->get_base_country(); $currency = get_kkart_currency(); $can_stripe = $this->is_stripe_supported_country( $country ); $can_eway = $this->is_eway_payments_supported_country( $country ); $can_payfast = ( 'ZA' === $country ); // South Africa. $can_paypal = $this->is_paypal_supported_currency( $currency ); if ( ! current_user_can( 'install_plugins' ) ) { return $can_paypal ? array( 'paypal' => $gateways['paypal'] ) : array(); } $klarna_or_square = false; if ( $this->is_klarna_checkout_supported_country( $country ) ) { $klarna_or_square = 'klarna_checkout'; } elseif ( $this->is_klarna_payments_supported_country( $country ) ) { $klarna_or_square = 'klarna_payments'; } elseif ( $this->is_square_supported_country( $country ) && get_option( 'kkart_sell_in_person' ) ) { $klarna_or_square = 'square'; } $offered_gateways = array(); if ( $can_stripe ) { $gateways['stripe']['enabled'] = true; $gateways['stripe']['featured'] = true; $offered_gateways += array( 'stripe' => $gateways['stripe'] ); } elseif ( $can_paypal ) { $gateways['ppec_paypal']['enabled'] = true; } if ( $klarna_or_square ) { if ( in_array( $klarna_or_square, array( 'klarna_checkout', 'klarna_payments' ), true ) ) { $gateways[ $klarna_or_square ]['enabled'] = true; $gateways[ $klarna_or_square ]['featured'] = false; $offered_gateways += array( $klarna_or_square => $gateways[ $klarna_or_square ], ); } else { $offered_gateways += array( $klarna_or_square => $gateways[ $klarna_or_square ], ); } } if ( $can_paypal ) { $offered_gateways += array( 'ppec_paypal' => $gateways['ppec_paypal'] ); } if ( $can_eway ) { $offered_gateways += array( 'eway' => $gateways['eway'] ); } if ( $can_payfast ) { $offered_gateways += array( 'payfast' => $gateways['payfast'] ); } return $offered_gateways; } /** * Simple array of "manual" gateways to show in wizard. * * @deprecated 4.6.0 * @return array */ public function get_wizard_manual_payment_gateways() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $gateways = array( 'cheque' => array( 'name' => _x( 'Check payments', 'Check payment method', 'kkart' ), 'description' => __( 'A simple offline gateway that lets you accept a check as method of payment.', 'kkart' ), 'image' => '', 'class' => '', ), 'bacs' => array( 'name' => __( 'Bank transfer (BACS) payments', 'kkart' ), 'description' => __( 'A simple offline gateway that lets you accept BACS payment.', 'kkart' ), 'image' => '', 'class' => '', ), 'cod' => array( 'name' => __( 'Cash on delivery', 'kkart' ), 'description' => __( 'A simple offline gateway that lets you accept cash on delivery.', 'kkart' ), 'image' => '', 'class' => '', ), ); return $gateways; } /** * Display service item in list. * * @param int $item_id Item ID. * @param array $item_info Item info array. * * @deprecated 4.6.0 */ public function display_service_item( $item_id, $item_info ) { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $item_class = 'kkart-wizard-service-item'; if ( isset( $item_info['class'] ) ) { $item_class .= ' ' . $item_info['class']; } $previously_saved_settings = get_option( 'kkart_' . $item_id . '_settings' ); // Show the user-saved state if it was previously saved. // Otherwise, rely on the item info. if ( is_array( $previously_saved_settings ) ) { $should_enable_toggle = ( isset( $previously_saved_settings['enabled'] ) && 'yes' === $previously_saved_settings['enabled'] ) ? true : ( isset( $item_info['enabled'] ) && $item_info['enabled'] ); } else { $should_enable_toggle = isset( $item_info['enabled'] ) && $item_info['enabled']; } $plugins = null; if ( isset( $item_info['repo-slug'] ) ) { $plugin = array( 'slug' => $item_info['repo-slug'], 'name' => $item_info['name'], ); $plugins = array( $plugin ); } ?>
  • <?php echo esc_attr( $item_info['name'] ); ?>

    data-plugins="" />
    $setting ) : ?>
    data-plugins="" />
  • is_featured_service( $service ); } /** * Payment Step. * * @deprecated 4.6.0 */ public function kkart_setup_payment() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $featured_gateways = array_filter( $this->get_wizard_in_cart_payment_gateways(), array( $this, 'is_featured_service' ) ); $in_cart_gateways = array_filter( $this->get_wizard_in_cart_payment_gateways(), array( $this, 'is_not_featured_service' ) ); $manual_gateways = $this->get_wizard_manual_payment_gateways(); ?>

    Additional payment methods can be installed later.', 'kkart' ), array( 'a' => array( 'href' => array(), 'target' => array(), ), ) ), esc_url( admin_url( 'admin.php?page=kkart-addons§ion=payment-gateways' ) ) ); ?>

    plugin_install_info(); ?>

    plugin_install_info(); ?>

    get_next_step_link() ) ) ); exit; } } /** * * @deprecated 4.6.0 */ protected function kkart_setup_activate_get_feature_list() { $features = array(); $stripe_settings = get_option( 'kkart_stripe_settings', false ); $stripe_enabled = is_array( $stripe_settings ) && isset( $stripe_settings['create_account'] ) && 'yes' === $stripe_settings['create_account'] && isset( $stripe_settings['enabled'] ) && 'yes' === $stripe_settings['enabled']; $ppec_settings = get_option( 'kkart_ppec_paypal_settings', false ); $ppec_enabled = is_array( $ppec_settings ) && isset( $ppec_settings['reroute_requests'] ) && 'yes' === $ppec_settings['reroute_requests'] && isset( $ppec_settings['enabled'] ) && 'yes' === $ppec_settings['enabled']; $features['payment'] = $stripe_enabled || $ppec_enabled; $features['taxes'] = (bool) get_option( 'kkart_setup_automated_taxes', false ); $features['labels'] = (bool) get_option( 'kkart_setup_shipping_labels', false ); return $features; } /** * * @deprecated 4.6.0 */ protected function kkart_setup_activate_get_feature_list_str() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $features = $this->kkart_setup_activate_get_feature_list(); if ( $features['payment'] && $features['taxes'] && $features['labels'] ) { return __( 'payment setup, automated taxes and discounted shipping labels', 'kkart' ); } else if ( $features['payment'] && $features['taxes'] ) { return __( 'payment setup and automated taxes', 'kkart' ); } else if ( $features['payment'] && $features['labels'] ) { return __( 'payment setup and discounted shipping labels', 'kkart' ); } else if ( $features['payment'] ) { return __( 'payment setup', 'kkart' ); } else if ( $features['taxes'] && $features['labels'] ) { return __( 'automated taxes and discounted shipping labels', 'kkart' ); } else if ( $features['taxes'] ) { return __( 'automated taxes', 'kkart' ); } else if ( $features['labels'] ) { return __( 'discounted shipping labels', 'kkart' ); } return false; } /** * Activate step. * * @deprecated 4.6.0 */ public function kkart_setup_activate() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $this->kkart_setup_activate_actions(); $jetpack_connected = class_exists( 'Jetpack' ) && Jetpack::is_active(); $has_jetpack_error = false; if ( isset( $_GET['activate_error'] ) ) { $has_jetpack_error = true; $title = __( "Sorry, we couldn't connect your store to Jetpack", 'kkart' ); $error_message = $this->get_activate_error_message( sanitize_text_field( wp_unslash( $_GET['activate_error'] ) ) ); $description = $error_message; } else { $feature_list = $this->kkart_setup_activate_get_feature_list_str(); $description = false; if ( $feature_list ) { if ( ! $jetpack_connected ) { /* translators: %s: list of features, potentially comma separated */ $description_base = __( 'Your store is almost ready! To activate services like %s, just connect with Jetpack.', 'kkart' ); } else { $description_base = __( 'Thanks for using Jetpack! Your store is almost ready: to activate services like %s, just connect your store.', 'kkart' ); } $description = sprintf( $description_base, $feature_list ); } if ( ! $jetpack_connected ) { $title = $feature_list ? __( 'Connect your store to Jetpack', 'kkart' ) : __( 'Connect your store to Jetpack to enable extra features', 'kkart' ); $button_text = __( 'Continue with Jetpack', 'kkart' ); } elseif ( $feature_list ) { $title = __( 'Connect your store to activate Kkart Services', 'kkart' ); $button_text = __( 'Continue with Kkart Services', 'kkart' ); } else { wp_redirect( esc_url_raw( $this->get_next_step_link() ) ); exit; } } ?>

    Terms of Service and to share details with WordPress.com', 'kkart' ) ), 'https://wordpress.com/tos', 'https://jetpack.com/support/what-data-does-jetpack-sync' ); ?>

    __( "Sorry! We tried, but we couldn't connect Jetpack just now 😭. Please go to the Plugins tab to connect Jetpack, so that you can finish setting up your store.", 'kkart' ), 'jetpack_cant_be_installed' => __( "Sorry! We tried, but we couldn't install Jetpack for you 😭. Please go to the Plugins tab to install it, and finish setting up your store.", 'kkart' ), 'register_http_request_failed' => __( "Sorry! We couldn't contact Jetpack just now 😭. Please make sure that your site is visible over the internet, and that it accepts incoming and outgoing requests via curl. You can also try to connect to Jetpack again, and if you run into any more issues, please contact support.", 'kkart' ), 'siteurl_private_ip_dev' => __( "Your site might be on a private network. Jetpack can only connect to public sites. Please make sure your site is visible over the internet, and then try connecting again 🙏." , 'kkart' ), ); } /** * * @deprecated 4.6.0 */ protected function get_activate_error_message( $code = '' ) { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); $errors = $this->get_all_activate_errors(); return array_key_exists( $code, $errors ) ? $errors[ $code ] : $errors['default']; } /** * Activate step save. * * Install, activate, and launch connection flow for Jetpack. * * @deprecated 4.6.0 */ public function kkart_setup_activate_save() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); } /** * Final step. * * @deprecated 4.6.0 */ public function kkart_setup_ready() { _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in Kkart Admin.' ); // We've made it! Don't prompt the user to run the wizard again. KKART_Admin_Notices::remove_notice( 'install', true ); $user_email = $this->get_current_user_email(); $docs_url = 'https://docs.kkart.com/documentation/plugins/kkart/getting-started/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=kkartplugin'; $help_text = sprintf( /* translators: %1$s: link to docs */ __( 'Visit Kkart.com to learn more about getting started.', 'kkart' ), $docs_url ); ?>