/** * Init ajax handlers * * @return void */ function init_ajax() { //withdraw note $withdraw = Dokan_Template_Withdraw::init(); add_action('wp_ajax_note', array($withdraw, 'note_update')); add_action('wp_ajax_withdraw_ajax_submission', array($withdraw, 'withdraw_ajax')); // reviews $reviews = Dokan_Template_reviews::init(); add_action('wp_ajax_dokan_comment_status', array($reviews, 'ajax_comment_status')); add_action('wp_ajax_dokan_update_comment', array($reviews, 'ajax_update_comment')); //settings $settings = Dokan_Template_Settings::init(); add_action('wp_ajax_dokan_settings', array($settings, 'ajax_settings')); add_action('wp_ajax_dokan-mark-order-complete', array($this, 'complete_order')); add_action('wp_ajax_dokan-mark-order-processing', array($this, 'process_order')); add_action('wp_ajax_dokan_grant_access_to_download', array($this, 'grant_access_to_download')); add_action('wp_ajax_dokan_change_status', array($this, 'change_order_status')); add_action('wp_ajax_dokan_contact_seller', array($this, 'contact_seller')); add_action('wp_ajax_dokan_add_variation', array($this, 'add_variation')); add_action('wp_ajax_dokan_link_all_variations', array($this, 'link_all_variations')); add_action('wp_ajax_dokan_save_attributes', array($this, 'save_attributes')); add_action('wp_ajax_dokan_toggle_seller', array($this, 'toggle_seller_status')); add_action('wp_ajax_nopriv_shop_url', array($this, 'shop_url_check')); add_filter('woocommerce_cart_item_name', array($this, 'seller_info_checkout'), 10, 2); }
/** * Init ajax handlers * * @return void */ function init_ajax() { //withdraw note $withdraw = Dokan_Template_Withdraw::init(); add_action('wp_ajax_note', array($withdraw, 'note_update')); add_action('wp_ajax_withdraw_ajax_submission', array($withdraw, 'withdraw_ajax')); // reviews $reviews = Dokan_Template_reviews::init(); add_action('wp_ajax_dokan_comment_status', array($reviews, 'ajax_comment_status')); add_action('wp_ajax_dokan_update_comment', array($reviews, 'ajax_update_comment')); //settings $settings = Dokan_Template_Settings::init(); add_action('wp_ajax_dokan_settings', array($settings, 'ajax_settings')); add_action('wp_ajax_dokan-mark-order-complete', array($this, 'complete_order')); add_action('wp_ajax_dokan-mark-order-processing', array($this, 'process_order')); add_action('wp_ajax_dokan_grant_access_to_download', array($this, 'grant_access_to_download')); add_action('wp_ajax_dokan_change_status', array($this, 'change_order_status')); add_action('wp_ajax_dokan_contact_seller', array($this, 'contact_seller')); add_action('wp_ajax_dokan_add_variation', array($this, 'add_variation')); add_action('wp_ajax_dokan_link_all_variations', array($this, 'link_all_variations')); add_action('wp_ajax_dokan_pre_define_attribute', array($this, 'dokan_pre_define_attribute')); add_action('wp_ajax_dokan_save_attributes', array($this, 'save_attributes')); add_action('wp_ajax_dokan_toggle_seller', array($this, 'toggle_seller_status')); add_action('wp_ajax_shop_url', array($this, 'shop_url_check')); add_action('wp_ajax_nopriv_shop_url', array($this, 'shop_url_check')); add_filter('woocommerce_cart_item_name', array($this, 'seller_info_checkout'), 10, 2); // Shipping ajax hanlding add_action('wp_ajax_dps_select_state_by_country', array($this, 'load_state_by_country')); add_action('wp_ajax_nopriv_dps_select_state_by_country', array($this, 'load_state_by_country')); // Announcement ajax handling add_action('wp_ajax_dokan_announcement_remove_row', array($this, 'remove_announcement')); add_action('wp_ajax_nopriv_dokan_announcement_remove_row', array($this, 'remove_announcement')); // shipping state ajax add_action('wp_ajax_nopriv_dokan_shipping_country_select', array($this, 'get_state_by_shipping_country')); add_action('wp_ajax_dokan_shipping_country_select', array($this, 'get_state_by_shipping_country')); // shipping calculation ajax add_action('wp_ajax_nopriv_dokan_shipping_calculator', array($this, 'get_calculated_shipping_cost')); add_action('wp_ajax_dokan_shipping_calculator', array($this, 'get_calculated_shipping_cost')); // Single product Design ajax add_action('wp_ajax_dokan_save_attributes_options', array($this, 'save_attributes_options')); add_action('wp_ajax_nopriv_dokan_save_attributes_options', array($this, 'save_attributes_options')); add_action('wp_ajax_dokan_save_variations_options', array($this, 'save_variations_options')); add_action('wp_ajax_nopriv_dokan_save_variations_options', array($this, 'save_variations_options')); add_action('wp_ajax_dokan_add_new_variations_options', array($this, 'add_new_variations_options')); add_action('wp_ajax_nopriv_dokan_add_new_variations_options', array($this, 'add_new_variations_options')); add_action('wp_ajax_dokan_remove_single_variation_item', array($this, 'remove_single_variation_item')); add_action('wp_ajax_nopriv_dokan_remove_single_variation_item', array($this, 'remove_single_variation_item')); add_action('wp_ajax_dokan_get_pre_attribute', array($this, 'add_predefined_attribute')); add_action('wp_ajax_nopriv_dokan_get_pre_attribute', array($this, 'add_predefined_attribute')); }
/** * Init ajax handlers * * @return void */ function init_ajax() { //withdraw note $withdraw = Dokan_Template_Withdraw::init(); add_action('wp_ajax_withdraw_ajax_submission', array($withdraw, 'withdraw_ajax')); //settings $settings = Dokan_Template_Settings::init(); add_action('wp_ajax_dokan_settings', array($settings, 'ajax_settings')); add_action('wp_ajax_dokan-mark-order-complete', array($this, 'complete_order')); add_action('wp_ajax_dokan-mark-order-processing', array($this, 'process_order')); add_action('wp_ajax_dokan_change_status', array($this, 'change_order_status')); add_action('wp_ajax_dokan_toggle_seller', array($this, 'toggle_seller_status')); add_action('wp_ajax_shop_url', array($this, 'shop_url_check')); add_action('wp_ajax_nopriv_shop_url', array($this, 'shop_url_check')); add_filter('woocommerce_cart_item_name', array($this, 'seller_info_checkout'), 10, 2); }
/** * Init all the classes * * @return void */ function init_classes() { if (is_admin()) { new Dokan_Admin_User_Profile(); Dokan_Admin_Ajax::init(); new Dokan_Upgrade(); } else { new Dokan_Pageviews(); } new Dokan_Rewrites(); Dokan_Email::init(); if (is_user_logged_in()) { Dokan_Template_Main::init(); Dokan_Template_Dashboard::init(); Dokan_Template_Products::init(); Dokan_Template_Orders::init(); Dokan_Template_Withdraw::init(); Dokan_Template_Shortcodes::init(); Dokan_Template_Settings::init(); } }
<?php $dokan_template_settings = Dokan_Template_Settings::init(); $validate = $dokan_template_settings->validate(); if ($validate !== false && !is_wp_error($validate)) { $dokan_template_settings->insert_settings_info(); } $scheme = is_ssl() ? 'https' : 'http'; wp_enqueue_script('google-maps', $scheme . '://maps.google.com/maps/api/js?sensor=true'); ?> <div class="dokan-dashboard-wrap"> <?php dokan_get_template('dashboard-nav.php', array('active_menu' => 'settings')); ?> <div class="dokan-dashboard-content dokan-settings-content"> <article class="dokan-settings-area"> <header class="dokan-dashboard-header"> <h1 class="entry-title"> <?php _e('Settings', 'dokan'); ?> <small>→ <a href="<?php echo dokan_get_store_url(get_current_user_id()); ?> "><?php _e('Visit Store', 'dokan'); ?> </a></small> </h1>