<?php do_action('dokan_product_tab_content', $post, $seller_id); ?> </div> <!-- .tab-content --> </div> <!-- .tabbable --> </div> <!-- .col-md-7 --> <!-- #################### Sidebar ######################### --> <div class="dokan-product-edit-right dokan-edit-sidebar"> <?php dokan_get_template_part('products/edit/sidebar', '', array('pro' => true, 'post' => $post, 'post_id' => $post_id)); ?> </div> <!-- .dokan-edit-sidebar --> </div> <!-- .product-edit-container --> </form> <?php } else { ?> <?php dokan_seller_not_enabled_notice(); ?> <?php
public function load_template_files() { global $wp; if (!function_exists('WC')) { return sprintf(__('Please install <a href="%s"><strong>WooCommerce</strong></a> plugin first', 'dokan'), 'http://wordpress.org/plugins/woocommerce/'); } if (isset($wp->query_vars['reports'])) { return dokan_get_template_part('reports'); } if (isset($wp->query_vars['products'])) { return dokan_get_template_part('products'); } if (isset($wp->query_vars['new-product'])) { return dokan_get_template_part('new-product'); } if (isset($wp->query_vars['orders'])) { return dokan_get_template_part('orders'); } if (isset($wp->query_vars['coupons'])) { return dokan_get_template_part('coupons'); } if (isset($wp->query_vars['reviews'])) { return dokan_get_template_part('reviews'); } if (isset($wp->query_vars['withdraw'])) { return dokan_get_template_part('withdraw'); } if (isset($wp->query_vars['settings'])) { return dokan_get_template_part('settings'); } //do_action( 'dokan_dashboard_template_render' ); return apply_filters('dokan_dashboard_template_render', dokan_get_template_part('dashboard')); }
/** * Show sub-orders on a parent order if available * * @param WC_Order $parent_order * @return void */ function dokan_order_show_suborders($parent_order) { $sub_orders = get_children(array('post_parent' => $parent_order->id, 'post_type' => 'shop_order', 'post_status' => array('wc-pending', 'wc-completed', 'wc-processing', 'wc-on-hold'))); if (!$sub_orders) { return; } $statuses = wc_get_order_statuses(); dokan_get_template_part('sub-orders', '', array('sub_orders' => $sub_orders, 'statuses' => $statuses)); }
/** * Get Order Main Content * * @since 2.4 * * @return void */ public function order_main_content() { $order_id = isset($_GET['order_id']) ? intval($_GET['order_id']) : 0; if ($order_id) { dokan_get_template_part('orders/details'); } else { dokan_get_template_part('orders/date-export'); dokan_get_template_part('orders/listing'); } }
function dokan_get_profile_progressbar() { global $current_user; $profile_info = dokan_get_store_info($current_user->ID); $progress = isset($profile_info['profile_completion']['progress']) ? $profile_info['profile_completion']['progress'] : 0; $next_todo = isset($profile_info['profile_completion']['next_todo']) ? $profile_info['profile_completion']['next_todo'] : __('Start with adding a Banner to gain profile progress', 'dokan'); ob_start(); if (strlen(trim($next_todo)) != 0) { dokan_get_template_part('global/profile-progressbar', '', array('pro' => true, 'progress' => $progress, 'next_todo' => $next_todo)); } $output = ob_get_clean(); return $output; }
/** * Outputs the HTML for this widget. * * @param array $args * @param array $instance [An array of settings for this widget instance] * * @return void Echoes it's output */ function widget($args, $instance) { extract($args, EXTR_SKIP); $title = apply_filters('widget_title', $instance['title']); $limit = absint($instance['count']) ? absint($instance['count']) : 10; $sellers = dokan_get_feature_sellers($limit); echo $before_widget; if (!empty($title)) { echo $args['before_title'] . $title . $args['after_title']; } dokan_get_template_part('widgets/feature-seller', '', array('pro' => true, 'sellers' => $sellers)); echo $after_widget; }
/** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget($args, $instance) { $title = apply_filters('widget_title', $instance['title']); extract($instance); $r = dokan_get_best_selling_products($no_of_product); echo $args['before_widget']; if (!empty($title)) { echo $args['before_title'] . $title . $args['after_title']; } dokan_get_template_part('widgets/widget-content-product', '', array('r' => $r, 'show_rating' => $show_rating)); echo $args['after_widget']; wp_reset_postdata(); }
/** * Outputs the HTML for this widget. * * @param array An array of standard parameters for widgets in this theme * @param array An array of settings for this widget instance * * @return void Echoes it's output */ function widget($args, $instance) { if (!dokan_is_store_page()) { return; } extract($args, EXTR_SKIP); $title = apply_filters('widget_title', $instance['title']); $store_info = dokan_get_store_info(get_query_var('author')); $map_location = isset($store_info['location']) ? esc_attr($store_info['location']) : ''; echo $before_widget; if (!empty($title)) { echo $args['before_title'] . $title . $args['after_title']; } dokan_get_template_part('widgets/store-map', '', array('pro' => true, 'store_info' => $store_info, 'map_location' => $map_location)); echo $after_widget; }
/** * Outputs the HTML for this widget. * * @param array An array of standard parameters for widgets in this theme * @param array An array of settings for this widget instance * * @return void Echoes it's output **/ function widget($args, $instance) { if (!dokan_is_store_page()) { return; } extract($args, EXTR_SKIP); $title = apply_filters('widget_title', $instance['title']); $seller_id = (int) get_query_var('author'); $store_info = dokan_get_store_info($seller_id); echo $before_widget; if (!empty($title)) { echo $args['before_title'] . $title . $args['after_title']; } dokan_get_template_part('widgets/store-contact-form', '', array('pro' => true, 'seller_id' => $seller_id, 'store_info' => $store_info)); echo $after_widget; }
/** * Get Dashboard Side Navigations * * @since 2.4 * * @return void */ public function get_dashboard_side_navigation() { global $wp; $request = $wp->request; $active = explode('/', $request); unset($active[0]); if ($active) { $active_menu = implode('/', $active); if ($active_menu == 'new-product') { $active_menu = 'products'; } if (get_query_var('edit') && is_singular('product')) { $active_menu = 'products'; } } else { $active_menu = 'dashboard'; } dokan_get_template_part('global/dashboard-nav', '', array('active_menu' => apply_filters('dokan_dashboard_nav_active', $active_menu, $request, $active))); }
/** * Returns the edit product template * * @param string $template * * @return string */ function product_edit_template($template) { if (!$this->is_woo_installed()) { return $template; } if (get_query_var('edit') && is_singular('product')) { return dokan_get_template_part('product-edit'); } return $template; }
/** * Load Shipping and tax content * * @since 2.4 * * @param object $post * @param integer $post_id * * @return void */ public function load_shipping_tax_content($post, $post_id) { $user_id = get_current_user_id(); $processing_time = dokan_get_shipping_processing_times(); $_required_tax = get_post_meta($post_id, '_required_tax', true); $_disable_shipping = get_post_meta($post_id, '_disable_shipping', true) ? get_post_meta($post_id, '_disable_shipping', true) : 'no'; $_additional_price = get_post_meta($post_id, '_additional_price', true); $_additional_qty = get_post_meta($post_id, '_additional_qty', true); $_processing_time = get_post_meta($post_id, '_dps_processing_time', true); $dps_shipping_type_price = get_user_meta($user_id, '_dps_shipping_type_price', true); $dps_additional_qty = get_user_meta($user_id, '_dps_additional_qty', true); $dps_pt = get_user_meta($user_id, '_dps_pt', true); $classes_options = $this->get_tax_class_option(); $porduct_shipping_pt = $_processing_time ? $_processing_time : $dps_pt; dokan_get_template_part('products/product-shipping-content', '', array('pro' => true, 'post' => $post, 'post_id' => $post_id, 'user_id' => $user_id, 'processing_time' => $processing_time, '_required_tax' => $_required_tax, '_disable_shipping' => $_disable_shipping, '_additional_price' => $_additional_price, '_additional_qty' => $_additional_qty, '_processing_time' => $_processing_time, 'dps_shipping_type_price' => $dps_shipping_type_price, 'dps_additional_qty' => $dps_additional_qty, 'dps_pt' => $dps_pt, 'classes_options' => $classes_options, 'porduct_shipping_pt' => $porduct_shipping_pt)); }
/** * Render Product Listing Template * * @since 2.4 * * @param string $action * * @return void */ public function render_product_listing_template($action) { dokan_get_template_part('products/products-listing'); }
/** * Load SEO Content * * @since 2.4 * * @return void */ public function load_seo_content() { dokan_get_template_part('settings/seo', '', array('pro' => true)); }
/** * Render my orders page * * @return string */ function my_orders_page() { return dokan_get_template_part('my-orders'); }
/** * Send email to seller once a product is published * * @param WP_Post $post * @param WP_User $seller */ function product_published($post, $seller) { ob_start(); dokan_get_template_part('emails/product-published'); $body = ob_get_clean(); $product = get_product($post->ID); $find = array('%seller_name%', '%title%', '%product_link%', '%product_edit_link%', '%site_name%', '%site_url%'); $replace = array($seller->display_name, $product->get_title(), get_permalink($post->ID), dokan_edit_product_url($post->ID), $this->get_from_name(), home_url()); $body = str_replace($find, $replace, $body); $subject = sprintf(__('[%s] Your product has been approved!', 'dokan'), $this->get_from_name()); $this->send($seller->user_email, $subject, $body); do_action('after_product_published', $seller->user_email, $subject, $body); }
* @package dokan - 2014 1.0 */ $store_user = get_userdata(get_query_var('author')); $store_info = dokan_get_store_info($store_user->ID); get_header(); ?> <?php get_sidebar('store'); ?> <div id="primary" class="content-area dokan-single-store"> <div id="content" class="site-content store-page-wrap woocommerce" role="main"> <?php dokan_get_template_part('store-header'); ?> <?php do_action('dokan_store_profile_frame_after', $store_user, $store_info); ?> <?php if (have_posts()) { ?> <div class="seller-items"> <?php woocommerce_product_loop_start(); ?>
/** * Print the approved user withdraw requests * * @param int $user_id * * @return void */ function user_approved_withdraws($user_id) { $requests = $this->get_withdraw_requests($user_id, 1, 100); if ($requests) { dokan_get_template_part('withdraw/approved-request-listing', '', array('requests' => $requests)); } else { dokan_get_template_part('global/dokan-warning', '', array('deleted' => false, 'message' => __('Sorry, no transactions were found!', 'dokan'))); } }
/** * Show announcement template * * @since 2.1 * * @return void */ function show_announcement_template() { $query = $this->get_announcement_by_users(); dokan_get_template_part('announcement/listing-announcement', '', array('pro' => true, 'notices' => $query->posts)); wp_reset_postdata(); $this->get_pagination($query); }
?> </label> </td> </tr> </tbody> </table> </div> <div class="dokan-variation-content-wrapper"></div> <?php } elseif ($_create_variations == 'yes') { ?> <?php dokan_get_template_part('products/edit/load_variation_template', '', array('pro' => true, 'post_id' => $post_id)); ?> <?php do_action('dokan_product_edit_after_variations'); ?> <div class="dokan-divider-top"></div> <label class="checkbox-inline form-label" for="_create_variation"> <input name="_create_variation" value="no" type="hidden"> <input name="_create_variation" id="_create_variation" value="yes" class="dokan_create_variation" type="checkbox" <?php checked($_create_variations, 'yes'); ?> > <?php
/** * Print SEO meta input form on frontend * * @since 2.3 * * @return void */ function frontend_meta_form() { $current_user = get_current_user_id(); $seller_profile = dokan_get_store_info($current_user); $seo_meta = isset($seller_profile['store_seo']) ? $seller_profile['store_seo'] : array(); $default_store_seo = array('dokan-seo-meta-title' => false, 'dokan-seo-meta-desc' => false, 'dokan-seo-meta-keywords' => false, 'dokan-seo-og-title' => false, 'dokan-seo-og-desc' => false, 'dokan-seo-og-image' => false, 'dokan-seo-twitter-title' => false, 'dokan-seo-twitter-desc' => false, 'dokan-seo-twitter-image' => false); $seo_meta = wp_parse_args($seo_meta, $default_store_seo); dokan_get_template_part('settings/seo-form', '', array('pro' => true, 'seo_meta' => $seo_meta, 'seller_profile' => $seller_profile, 'seo' => $this)); }
/** * Get announcement widget * * @return void */ public function get_announcement_widget() { $template_notice = Dokan_Pro_Notice::init(); $query = $template_notice->get_announcement_by_users(apply_filters('dokan_announcement_list_number', 3)); dokan_get_template_part('dashboard/announcement-widget', '', array('pro' => true, 'notices' => $query->posts, 'announcement_url' => dokan_get_navigation_url('announcement'))); }
?> </div> </div> </div> <div class="clear"></div> <div class="" style="100%"> <div class="dokan-panel dokan-panel-default"> <div class="dokan-panel-heading"><strong><?php _e('Downloadable Product Permission', 'dokan'); ?> </strong></div> <div class="dokan-panel-body"> <?php dokan_get_template_part('orders/downloadable', '', array('order' => $order)); ?> </div> </div> </div> </div> </div> <div class="dokan-w4"> <div class="row dokan-clearfix"> <div class="" style="width:100%"> <div class="dokan-panel dokan-panel-default"> <div class="dokan-panel-heading"><strong><?php _e('General Details', 'dokan'); ?> </strong></div>
/** * Returns the edit product template * * @param string $template * * @return string */ function product_edit_template($template) { if (!$this->is_woo_installed()) { return $template; } if (get_query_var('edit') && is_singular('product')) { if (dokan_get_option('product_style', 'dokan_selling', 'old') == 'old') { $edit_product_url = dokan_get_template_part('product-edit'); } elseif (dokan_get_option('product_style', 'dokan_selling', 'old') == 'new') { $edit_product_url = dokan_get_template_part('new-product-single'); } return $edit_product_url; } return $template; }
/** * Load Payment Content * * @since 2.4 * * @return void */ public function load_payment_content() { $methods = dokan_withdraw_get_active_methods(); $currentuser = get_current_user_id(); $profile_info = dokan_get_store_info(get_current_user_id()); dokan_get_template_part('settings/payment', '', array('methods' => $methods, 'current_user' => $currentuser, 'profile_info' => $profile_info)); }
/** * Show Comment filter menu * * @since 2.4 * * @param string $post_type * * @return void */ function review_comments_menu($post_type, $counts) { $url = dokan_get_navigation_url('reviews'); $pending = isset($counts->moderated) ? $counts->moderated : 0; $spam = isset($counts->spam) ? $counts->spam : 0; $trash = isset($counts->trash) ? $counts->trash : 0; dokan_get_template_part('review/status-filter', '', array('pro' => true, 'url' => $url, 'pending' => $pending, 'spam' => $spam, 'trash' => $trash)); }
/** * User top navigation menu * * @return void */ function dokan_header_user_menu() { global $current_user; $user_id = $current_user->ID; $nav_urls = dokan_get_dashboard_nav(); dokan_get_template_part('global/header-menu', '', array('current_user' => $current_user, 'user_id' => $user_id, 'nav_urls' => $nav_urls)); }
/** * Render Add Coupon Form * * @param object $validated * * @return void */ function add_coupons_form($validated) { //intial time hide this function if (!isset($_GET['view'])) { return; } else { if ($_GET['view'] != 'add_coupons') { return; } } $button_name = __('Create Coupon', 'dokan'); if (isset($_GET['post']) && $_GET['action'] == 'edit') { if (!wp_verify_nonce($_GET['coupon_nonce_url'], '_coupon_nonce')) { wp_die(__('Are you cheating?', 'dokan')); } $post = get_post($_GET['post']); $button_name = __('Update Coupon', 'dokan'); $discount_type = get_post_meta($post->ID, 'discount_type', true); $amount = get_post_meta($post->ID, 'coupon_amount', true); $products = get_post_meta($post->ID, 'product_ids', true); $exclude_products = get_post_meta($post->ID, 'exclude_product_ids', true); $usage_limit = get_post_meta($post->ID, 'usage_limit', true); $expire = get_post_meta($post->ID, 'expiry_date', true); $apply_before_tax = get_post_meta($post->ID, 'apply_before_tax', true); //$free_shipping = get_post_meta( $post->ID, 'free_shipping', true ); $exclide_sale_item = get_post_meta($post->ID, 'exclude_sale_items', true); $minimum_amount = get_post_meta($post->ID, 'minimum_amount', true); $customer_email = get_post_meta($post->ID, 'customer_email', true); } $post_id = isset($post->ID) ? $post->ID : ''; $post_title = isset($post->post_title) ? $post->post_title : ''; $description = isset($post->post_content) ? $post->post_content : ''; $discount_type = isset($discount_type) ? $discount_type : ''; if (isset($discount_type)) { if ($discount_type == 'percent_product') { $discount_type = 'selected'; } } $amount = isset($amount) ? $amount : ''; $products = isset($products) ? $products : ''; $exclude_products = isset($exclude_products) ? $exclude_products : ''; $usage_limit = isset($usage_limit) ? $usage_limit : ''; $expire = isset($expire) ? $expire : ''; $products_id = str_replace(' ', '', $products); $products_id = explode(',', $products_id); if (isset($apply_before_tax) && $apply_before_tax == 'yes') { $apply_before_tax = 'checked'; } else { $apply_before_tax = ''; } if (isset($exclide_sale_item) && $exclide_sale_item == 'yes') { $exclide_sale_item = 'checked'; } else { $exclide_sale_item = ''; } $minimum_amount = isset($minimum_amount) ? $minimum_amount : ''; $customer_email = isset($customer_email) ? implode(',', $customer_email) : ''; if (is_wp_error($validated)) { $post_id = $_POST['post_id']; $post_title = $_POST['title']; $description = $_POST['description']; $discount_type = $_POST['discount_type']; if ($discount_type == 'percent_product') { $discount_type = 'selected'; } $amount = $_POST['amount']; if (isset($_POST['product_drop_down'])) { $products = implode(',', array_filter(array_map('intval', (array) $_POST['product_drop_down']))); } else { $products = ''; } if (isset($_POST['exclude_product_ids'])) { $exclude_products = implode(',', array_filter(array_map('intval', (array) $_POST['exclude_product_ids']))); } else { $exclude_products = ''; } $usage_limit = $_POST['usage_limit']; $expire = $_POST['expire']; if (isset($_POST['apply_before_tax']) && $_POST['apply_before_tax'] == 'yes') { $apply_before_tax = 'checked'; } else { $apply_before_tax = ''; } if (isset($_POST['exclude_sale_items']) && $_POST['exclude_sale_items'] == 'yes') { $exclide_sale_item = 'checked'; } else { $exclide_sale_item = ''; } $minimum_amount = $_POST['minium_ammount']; $customer_email = $_POST['email_restrictions']; } $username = get_the_author_meta('login', get_current_user_id()); if (strpos($post_title, $username) !== 0) { $post_title = $username . "_" . $post_title; } $exclude_products = str_replace(' ', '', $exclude_products); $exclude_products = explode(',', $exclude_products); dokan_get_template_part('coupon/form', '', array('pro' => true, 'post_id' => $post_id, 'post_title' => $post_title, 'discount_type' => $discount_type, 'description' => $description, 'amount' => $amount, 'products' => $products, 'exclude_products' => $exclude_products, 'usage_limit' => $usage_limit, 'expire' => $expire, 'minimum_amount' => $minimum_amount, 'customer_email' => $customer_email, 'button_name' => $button_name, 'exclide_sale_item' => $exclide_sale_item, 'all_products' => $this->coupon_products_list(), 'products_id' => $products_id)); }
/** * Render Review Content * * @return [type] [description] */ public function render_review_content() { global $woocommerce; require_once DOKAN_PRO_INC . '/reports.php'; $charts = dokan_get_reports_charts(); $link = dokan_get_navigation_url('reports'); $current = isset($_GET['chart']) ? $_GET['chart'] : 'overview'; dokan_get_template_part('report/content', '', array('pro' => true, 'charts' => $charts, 'link' => $link, 'current' => $current)); }
<?php do_action('dokan_product_tab_content', $post, $seller_id); ?> </div> <!-- .tab-content --> </div> <!-- .tabbable --> </div> <!-- .col-md-7 --> <!-- #################### Sidebar ######################### --> <div class="dokan-product-edit-right dokan-edit-sidebar"> <?php dokan_get_template_part('edit/sidebar'); ?> </div> <!-- .dokan-edit-sidebar --> </div> <!-- .product-edit-container --> </form> </div> <!-- .row --> </div> <!-- #primary .content-area --> </div><!-- .dokan-dashboard-wrap --> <script> (function($){ $(document).ready(function(){ $('#tab-container').easytabs(); });