/**
 * Displays the store lists
 *
 * @since 2.4
 *
 * @param  array $atts
 *
 * @return string
 */
function store_listing($atts)
{
    global $post;
    /**
     * Filter return the number of store listing number per page.
     *
     * @since 2.2
     *
     * @param array
     */
    $attr = shortcode_atts(apply_filters('dokan_store_listing_per_page', array('per_page' => 10)), $atts);
    $paged = max(1, get_query_var('paged'));
    $limit = $attr['per_page'];
    $offset = ($paged - 1) * $limit;
    $sellers = dokan_get_sellers($limit, $offset);
    ob_start();
    if ($sellers['users']) {
        ?>
    <ul class="dokan-seller-wrap">
        <?php 
        foreach ($sellers['users'] as $seller) {
            $store_info = dokan_get_store_info($seller->ID);
            $banner_id = isset($store_info['banner']) ? $store_info['banner'] : 0;
            $store_name = isset($store_info['store_name']) ? esc_html($store_info['store_name']) : __('N/A', 'dokan');
            $store_url = dokan_get_store_url($seller->ID);
            ?>

            <li class="dokan-single-seller">
                <div class="dokan-store-thumbnail">

                    <a href="<?php 
            echo $store_url;
            ?>
">
                        <?php 
            if ($banner_id) {
                $banner_url = wp_get_attachment_image_src($banner_id, 'medium');
                ?>
                            <img class="dokan-store-img" src="<?php 
                echo esc_url($banner_url[0]);
                ?>
" alt="<?php 
                echo esc_attr($store_name);
                ?>
">
                        <?php 
            } else {
                ?>
                            <img class="dokan-store-img" src="<?php 
                echo dokan_get_no_seller_image();
                ?>
" alt="<?php 
                _e('No Image', 'dokan');
                ?>
">
                        <?php 
            }
            ?>
                    </a>

                    <div class="dokan-store-caption">
                        <h3><a href="<?php 
            echo $store_url;
            ?>
"><?php 
            echo $store_name;
            ?>
</a></h3>

                        <address>

                            <?php 
            if (isset($store_info['address']) && !empty($store_info['address'])) {
                echo dokan_get_seller_address($seller->ID);
            }
            ?>

                            <?php 
            if (isset($store_info['phone']) && !empty($store_info['phone'])) {
                ?>
                                <br>
                                <abbr title="<?php 
                _e('Phone Number', 'dokan');
                ?>
"><?php 
                _e('P:', 'dokan');
                ?>
</abbr> <?php 
                echo esc_html($store_info['phone']);
                ?>
                            <?php 
            }
            ?>

                        </address>

                        <p><a class="dokan-btn dokan-btn-theme" href="<?php 
            echo $store_url;
            ?>
"><?php 
            _e('Visit Store', 'dokan');
            ?>
</a></p>

                    </div> <!-- .caption -->
                </div> <!-- .thumbnail -->
            </li> <!-- .single-seller -->
        <?php 
        }
        ?>
    </ul> <!-- .dokan-seller-wrap -->

    <?php 
        $user_count = $sellers['count'];
        $num_of_pages = ceil($user_count / $limit);
        if ($num_of_pages > 1) {
            echo '<div class="pagination-container clearfix">';
            $page_links = paginate_links(array('current' => $paged, 'total' => $num_of_pages, 'base' => str_replace($post->ID, '%#%', esc_url(get_pagenum_link($post->ID))), 'type' => 'array', 'prev_text' => __('&larr; Previous', 'dokan'), 'next_text' => __('Next &rarr;', 'dokan')));
            if ($page_links) {
                $pagination_links = '<div class="pagination-wrap">';
                $pagination_links .= '<ul class="pagination"><li>';
                $pagination_links .= join("</li>\n\t<li>", $page_links);
                $pagination_links .= "</li>\n</ul>\n";
                $pagination_links .= '</div>';
                echo $pagination_links;
            }
            echo '</div>';
        }
        ?>

    <?php 
    } else {
        ?>
        <p class="dokan-error"><?php 
        _e('No seller found!', 'dokan');
        ?>
</p>
    <?php 
    }
    $content = ob_get_clean();
    return apply_filters('dokan_seller_listing', $content, $attr);
}
Beispiel #2
1
/**
 * Prints seller info in product single page
 *
 * @global WC_Product $product
 * @param type $val
 */
function dokan_product_seller_tab($val)
{
    global $product;
    $author = get_user_by('id', $product->post->post_author);
    $store_info = dokan_get_store_info($author->ID);
    dokan_get_template_part('global/product-tab', '', array('author' => $author, 'store_info' => $store_info));
}
Beispiel #3
1
 /**
  * Displaying Prodcuts
  *
  * Does prepare the data for displaying the products in the table.
  */
 function display_newsletter()
 {
     $data = array();
     $prefix = FARMTOYOU_META_PREFIX;
     //if search is call then pass searching value to function for displaying searching values
     $args = array('post_type' => FARMTOYOU_NEWSLETTER_POST_TYPE, 'post_status' => 'any', 'posts_per_page' => '-1');
     //get newsletter data from database
     $all_newsletter = get_posts($args);
     foreach ($all_newsletter as $key => $value) {
         $seller_id = get_post_meta($value->ID, $prefix . 'post_author', true);
         $store_info = dokan_get_store_info($seller_id);
         $store_name = isset($store_info['store_name']) ? esc_html($store_info['store_name']) : __('N/A', 'dokan');
         $user_id = get_post_meta($value->ID, $prefix . 'curr_user_id', true);
         $user_info = get_userdata($user_id);
         $first_name = $user_info->first_name;
         $last_name = $user_info->last_name;
         $data[$key]['ID'] = isset($value->ID) ? $value->ID : '';
         $data[$key]['post_author'] = $store_name;
         $data[$key]['post_email'] = get_post_meta($value->ID, $prefix . 'post_title', true);
         $data[$key]['user_name'] = $first_name . " " . $last_name;
         $data[$key]['post_status'] = isset($value->post_status) && $value->post_status == 'publish' ? 'Active' : 'Inactive';
         $data[$key]['post_date'] = isset($value->post_date) ? $value->post_date : '';
     }
     return $data;
 }
/**
 * Upgrade store meta for sellers
 * and replace old address meta with new address meta
 *
 * @since 2.3
 *
 * @return void
 */
function upgrade_store_meta_23()
{
    $query = new WP_User_Query(array('role' => 'seller'));
    $sellers = $query->get_results();
    $default_settings = array('store_name' => '', 'location' => '', 'find_address' => '', 'banner' => '', 'phone' => '', 'show_email' => '', 'gravatar' => '', 'payment' => array(), 'social' => array());
    foreach ($sellers as $seller) {
        $current_settings = dokan_get_store_info($seller->ID);
        $current_settings = wp_parse_args($current_settings, $default_settings);
        $old_address = $current_settings['address'];
        $new_address = array('street_1' => $old_address, 'street_2' => '', 'city' => '', 'zip' => '', 'country' => '', 'state' => '');
        $current_settings['address'] = $new_address;
        update_user_meta($seller->ID, 'dokan_profile_settings', $current_settings);
    }
}
function add_checkout_options()
{
    global $woocommerce;
    $vendor_ids = array();
    foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) {
        if (!in_array($cart_item['data']->post->post_author, $vendor_ids)) {
            $vendor_ids[] = $cart_item['data']->post->post_author;
        }
    }
    ?>
        <div class="your-order">
            <?php 
    foreach ($vendor_ids as $vendor_id) {
        $store_settings = dokan_get_store_info($vendor_id);
        $shipping_charge = get_user_meta($vendor_id, 'dokan_enable_seller_shipping', true);
        $seller_shipping_charge = get_user_meta($vendor_id, 'dokan_seller_shipping_charge', true);
        $currency_symbol = get_woocommerce_currency_symbol();
        ?>

                    <span class="order-title"><?php 
        echo $store_settings['store_name'];
        ?>
</span>
                    <div class="order-raw">
                        <input type="radio" name="dokan_product_shipping_choice[<?php 
        echo $vendor_id;
        ?>
]" class="dokan_product_shipping_choice" data-id="<?php 
        echo $vendor_id;
        ?>
" value="dokan_product_pick_at_farm">
                        <label>Pick up at the farm (<?php 
        echo $store_settings['address'];
        ?>
)</label>
                        <?php 
        if ($shipping_charge == "yes") {
            ?>
                            <input type="radio" name="dokan_product_shipping_choice[<?php 
            echo $vendor_id;
            ?>
]" class="dokan_product_shipping_choice" data-id="<?php 
            echo $vendor_id;
            ?>
" value="dokan_product_shipping">
                            <label>Shipping (<?php 
            echo $currency_symbol . " " . $seller_shipping_charge;
            ?>
)</label>
                        <?php 
        }
        ?>
    
                    </div>
                <?php 
    }
    ?>
        </div>  
<?php 
}
Beispiel #6
0
 /**
  * Injects seller name on checkout page
  *
  * @param array $item_data
  * @param array $cart_item
  * @return array
  */
 function seller_info_checkout($item_data, $cart_item)
 {
     $info = dokan_get_store_info($cart_item['data']->post->post_author);
     $seller = sprintf(__('<strong>Seller:</strong> %s', 'dokan'), $info['store_name']);
     $data = $item_data . $seller;
     return apply_filters('dokan_seller_info_checkout', $data, $info, $item_data, $cart_item);
 }
 /**
  * Displaying Prodcuts
  *
  * Does prepare the data for displaying the products in the table.
  */
 function display_seller_review()
 {
     $data = array();
     $prefix = FARMTOYOU_META_PREFIX;
     //if search is call then pass searching value to function for displaying searching values
     $args = array('post_type' => FARMTOYOU_SELLER_REVIEW_POST_TYPE, 'post_status' => 'any', 'posts_per_page' => '-1');
     //get seller_review data from database
     $all_seller_review = get_posts($args);
     foreach ($all_seller_review as $key => $value) {
         $seller_id = get_post_meta($value->ID, $prefix . 'seller_id', true);
         $store_info = dokan_get_store_info($seller_id);
         $store_name = isset($store_info['store_name']) ? esc_html($store_info['store_name']) : __('N/A', 'dokan');
         $curr_user_id = get_post_meta($value->ID, $prefix . 'current_user_id', true);
         $user_info = get_userdata($curr_user_id);
         $first_name = $user_info->first_name;
         $last_name = $user_info->last_name;
         $user_email = $user_info->user_email;
         $data[$key]['ID'] = isset($value->ID) ? $value->ID : '';
         $data[$key]['seller_store'] = $store_name;
         $data[$key]['curr_user_name'] = $first_name . " " . $last_name;
         $data[$key]['curr_user_email'] = $user_email;
         $data[$key]['user_rating'] = get_post_meta($value->ID, $prefix . 'seller_rating', true);
         $data[$key]['user_comment'] = get_post_meta($value->ID, $prefix . 'user_comment', true);
         $data[$key]['post_status'] = isset($value->post_status) ? $value->post_status : '';
         $data[$key]['post_date'] = isset($value->post_date) ? $value->post_date : '';
     }
     return $data;
 }
Beispiel #8
0
    /**
     * 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'];
        }
        ?>

        <form id="dokan-form-contact-seller" action="" method="post" class="seller-form clearfix">
            <div class="ajax-response"></div>
            <ul>
                <li class="form-group">
                    <input type="text" name="name" value="" placeholder="<?php 
        esc_attr_e('Your Name', 'dokan');
        ?>
" class="form-control" minlength="5" required="required">
                </li>
                <li class="form-group">
                    <input type="email" name="email" value="" placeholder="<?php 
        esc_attr_e('*****@*****.**', 'dokan');
        ?>
" class="form-control" required="required">
                </li>
                <li class="form-group">
                    <textarea  name="message" maxlength="1000" cols="25" rows="6" value="" placeholder="<?php 
        esc_attr_e('Type your messsage...', 'dokan');
        ?>
" class="form-control" required="required"></textarea>
                </li>
            </ul>

            <?php 
        wp_nonce_field('dokan_contact_seller');
        ?>
            <input type="hidden" name="seller_id" value="<?php 
        echo $seller_id;
        ?>
">
            <input type="hidden" name="action" value="dokan_contact_seller">
            <input type="submit" name="store_message_send" value="<?php 
        esc_attr_e('Send Message', 'dokan');
        ?>
" class="dokan-right dokan-btn dokan-btn-theme">
        </form>

        <?php 
        echo $after_widget;
    }
        function seller_info_intro()
        {
            $store_info = dokan_get_store_info(get_the_author_meta('ID'));
            $store_intro = $store_info['phone'];
            ?>
			<div><?php 
            echo $store_intro;
            ?>
</div>
			<?php 
        }
Beispiel #10
0
 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;
 }
Beispiel #11
0
 /**
  * Load autometically when class initiate
  *
  * @since 2.4
  *
  * @uses actions hook
  * @uses filter hook
  *
  * @return void
  */
 public function __construct()
 {
     $this->currentuser = get_current_user_id();
     $this->profile_info = dokan_get_store_info(get_current_user_id());
     add_filter('dokan_get_dashboard_settings_nav', array($this, 'load_settings_menu'), 10);
     add_filter('dokan_dashboard_settings_heading_title', array($this, 'load_settings_header'), 10, 2);
     add_filter('dokan_dashboard_settings_helper_text', array($this, 'load_settings_helper_text'), 10, 2);
     add_action('dokan_ajax_settings_response', array($this, 'add_progressbar_in_settings_save_response'), 10);
     add_action('dokan_settings_load_ajax_response', array($this, 'render_pro_settings_load_progressbar'), 25);
     add_action('dokan_settings_render_profile_progressbar', array($this, 'load_settings_progressbar'), 10, 2);
     add_action('dokan_settings_content_area_header', array($this, 'render_shipping_status_message'), 25);
     add_action('dokan_render_settings_content', array($this, 'load_settings_content'), 10);
 }
 /**
  * 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;
 }
Beispiel #14
0
    /**
     * 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)
    {
        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'];
        }
        ?>
        <ul class="dokan-feature-sellers">
            <?php 
        if ($sellers) {
            foreach ($sellers as $key => $seller) {
                $store_info = dokan_get_store_info($seller->ID);
                $rating = dokan_get_seller_rating($seller->ID);
                $display_rating = $rating['rating'];
                if (!$rating['count']) {
                    $display_rating = __('No ratings found yet!', 'dokan');
                }
                ?>
                    <li>
                        <a href="<?php 
                echo dokan_get_store_url($seller->ID);
                ?>
">
                            <?php 
                echo esc_html($store_info['store_name']);
                ?>
                        </a><br />
                        <i class='fa fa-star'></i>
                        <?php 
                echo $display_rating;
                ?>
                    </li>

                    <?php 
            }
        }
        ?>
        </ul>
        <?php 
        echo $after_widget;
    }
Beispiel #15
0
    /**
     * 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'];
        }
        ?>

        <div class="location-container">

            <?php 
        if (!empty($map_location)) {
            ?>
                <div id="dokan-store-location"></div>

                <script type="text/javascript">
                    jQuery(function($) {
                        <?php 
            $locations = explode(',', $map_location);
            $def_lat = isset($locations[0]) ? $locations[0] : 90.40714300000002;
            $def_long = isset($locations[1]) ? $locations[1] : 23.709921;
            ?>

                        var def_longval = <?php 
            echo $def_long;
            ?>
;
                        var def_latval = <?php 
            echo $def_lat;
            ?>
;

                        var curpoint = new google.maps.LatLng(def_latval, def_longval),
                            $map_area = $('#dokan-store-location');

                        var gmap = new google.maps.Map( $map_area[0], {
                            center: curpoint,
                            zoom: 15,
                            mapTypeId: window.google.maps.MapTypeId.ROADMAP
                        });

                        var marker = new window.google.maps.Marker({
                            position: curpoint,
                            map: gmap
                        });
                    })

                </script>
            <?php 
        }
        ?>
        </div>

        <?php 
        echo $after_widget;
    }
Beispiel #16
0
    /**
     * Announcement metabox callback function
     *
     * @param  integer $post_id
     *
     * @return void
     */
    function meta_boxes_cb($post_id)
    {
        global $post;
        $user_search = new WP_User_Query(array('role' => 'seller'));
        $sellers = $user_search->get_results();
        $announcement_type = get_post_meta($post->ID, '_announcement_type', true);
        $announcement_users = get_post_meta($post->ID, '_announcement_selected_user', true);
        $announcement_sellers = $announcement_users ? $announcement_users : array();
        ?>
            <table class="form-table dokan-announcement-meta-wrap-table">
                <tr>
                    <th><?php 
        _e('Send Announcement To', 'dokan');
        ?>
</th>
                    <td>
                        <select name="dokan_announcement_assign_type" id="dokan_announcement_assign_type" style="width:60%">
                            <?php 
        foreach ($this->assign_type as $key => $type) {
            ?>
                                <option value="<?php 
            echo $key;
            ?>
" <?php 
            selected($announcement_type, $key);
            ?>
><?php 
            echo $type;
            ?>
</option>
                            <?php 
        }
        ?>
                        </select>
                    </td>
                </tr>

                <tr class="selected_seller_field">
                    <th><?php 
        _e('Select Sellers', 'dokan');
        ?>
</th>
                    <td>
                        <select name="dokan_announcement_assign_seller[]" data-placeholder= '<?php 
        echo __('Select Sellers...', 'dokan');
        ?>
' id="dokan_announcement_assign_seller" multiple="multiple">
                            <option></option>
                            <?php 
        foreach ($sellers as $user) {
            $info = dokan_get_store_info($user->ID);
            if (isset($info['store_name'])) {
                ?>
                                    <option <?php 
                echo in_array($user->ID, $announcement_sellers) ? 'selected="selected"' : '';
                ?>
 value='<?php 
                echo $user->ID;
                ?>
'><?php 
                echo esc_html($info['store_name']);
                ?>
</option>
                                <?php 
            }
            ?>
                            <?php 
        }
        ?>

                        </select>
                    </td>
                </tr>
            </table>
            <?php 
        wp_nonce_field('dokan_announcement_meta_action', 'dokan_announcement_meta_action_nonce');
        ?>

            <script>
                (function($){
                    $(document).ready( function() {
                        $('#dokan_announcement_assign_seller').chosen( { width: '60%' });
                        $('table.dokan-announcement-meta-wrap-table').on( 'change', 'select#dokan_announcement_assign_type', function(){
                            var self = $(this);

                            if ( self.val() == 'selected_seller' ) {
                                $( 'tr.selected_seller_field' ).show();
                            } else {
                                $( 'tr.selected_seller_field' ).hide();
                            }
                        });

                        $('select#dokan_announcement_assign_type').trigger('change')
                    });
                })(jQuery);
            </script>
            <style>
                .chosen-choices li.search-field input[type="text"] {
                    height: 23px !important;
                }
                tr.selected_seller_field{
                    display: none;
                }
            </style>
        <?php 
    }
<?php

/**
 * Dokan Featured Seller Widget Content Template
 *
 * @since 2.4
 *
 * @package dokan
 */
?>

<ul class="dokan-feature-sellers">
    <?php 
if ($sellers) {
    foreach ($sellers as $key => $seller) {
        $store_info = dokan_get_store_info($seller->ID);
        $rating = dokan_get_seller_rating($seller->ID);
        $display_rating = $rating['rating'];
        if (!$rating['count']) {
            $display_rating = __('No ratings found yet!', 'dokan');
        }
        ?>
            <li>
                <a href="<?php 
        echo dokan_get_store_url($seller->ID);
        ?>
">
                    <?php 
        echo esc_html($store_info['store_name']);
        ?>
                </a><br />
Beispiel #18
0
/**
 * Prints seller info in product single page
 *
 * @global WC_Product $product
 * @param type $val
 */
function dokan_product_seller_tab($val)
{
    global $product;
    $author = get_user_by('id', $product->post->post_author);
    $store_info = dokan_get_store_info($author->ID);
    ?>
    <h2><?php 
    _e('Seller Information', 'dokan');
    ?>
</h2>
    <ul class="list-unstyled">

        <?php 
    if (!empty($store_info['store_name'])) {
        ?>
            <li class="store-name">
                <span><?php 
        _e('Store Name:', 'dokan');
        ?>
</span>
                <span class="details">
                    <?php 
        echo esc_html($store_info['store_name']);
        ?>
                </span>
            </li>
        <?php 
    }
    ?>

        <li class="seller-name">
            <span>
                <?php 
    _e('Seller:', 'dokan');
    ?>
            </span>

            <span class="details">
                <?php 
    printf('<a href="%s">%s</a>', dokan_get_store_url($author->ID), $author->display_name);
    ?>
            </span>
        </li>
        <?php 
    if (!empty($store_info['address'])) {
        ?>
            <li class="store-address">
                <span><?php 
        _e('Address:', 'dokan');
        ?>
</span>
                <span class="details">
                    <?php 
        echo esc_html($store_info['address']);
        ?>
                </span>
            </li>
        <?php 
    }
    ?>

        <li class="clearfix">
            <?php 
    dokan_get_readable_seller_rating($author->ID);
    ?>
        </li>
    </ul>

    <?php 
}
    /**
     * Withdraw listing for admin
     *
     * @param  string  $status
     *
     * @return void
     */
    function admin_withdraw_list($status)
    {
        $pagenum = isset($_GET['paged']) ? absint($_GET['paged']) : 1;
        $limit = 20;
        $offset = ($pagenum - 1) * $limit;
        $result = $this->get_withdraw_requests('', $this->get_status_code($status), $limit, $offset);
        ?>

        <?php 
        if (isset($_GET['message'])) {
            $message = '';
            switch ($_GET['message']) {
                case 'trashed':
                    $message = __('Requests deleted!', 'dokan');
                    break;
                case 'cancelled':
                    $message = __('Requests cancelled!', 'dokan');
                    break;
                case 'approved':
                    $message = __('Requests approved!', 'dokan');
                    break;
            }
            if (!empty($message)) {
                ?>
                <div class="updated">
                    <p><strong><?php 
                echo $message;
                ?>
</strong></p>
                </div>
                <?php 
            }
        }
        ?>
        <form method="post" action="" id="dokan-admin-withdraw-action">
            <?php 
        wp_nonce_field('dokan_withdraw_admin_bulk_action', 'dokan_withdraw_admin_bulk_action_nonce');
        ?>
            
            <table class="widefat withdraw-table">
                <thead>
                    <tr>
                        <th class="check-column">
                            <input type="checkbox" class="dokan-withdraw-allcheck">
                        </th>
                        <th><?php 
        _e('User Name', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('Amount', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('Method', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('Method Details', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('Note', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('IP', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('Date', 'dokan');
        ?>
</th>
                    </tr>
                </thead>
                <tfoot>
                    <tr>
                        <th class="check-column">
                            <input type="checkbox" class="dokan-withdraw-allcheck">
                        </th>
                        <th><?php 
        _e('User Name', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('Amount', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('Method', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('Method Details', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('Note', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('IP', 'dokan');
        ?>
</th>
                        <th><?php 
        _e('Date', 'dokan');
        ?>
</th>
                    </tr>
                </tfoot>

            <?php 
        if ($result) {
            $count = 0;
            foreach ($result as $key => $row) {
                $user_data = get_userdata($row->user_id);
                $store_info = dokan_get_store_info($row->user_id);
                ?>
                    <tr class="<?php 
                echo $count % 2 == 0 ? 'alternate' : 'odd';
                ?>
">

                        <th class="check-column">
                            <input type="checkbox" name="id[<?php 
                echo $row->id;
                ?>
]" value="<?php 
                echo $row->id;
                ?>
">
                            <input type="hidden" name="user_id[<?php 
                echo $row->id;
                ?>
]" value="<?php 
                echo $row->user_id;
                ?>
">
                            <input type="hidden" name="method[<?php 
                echo $row->id;
                ?>
]" value="<?php 
                echo esc_attr($row->method);
                ?>
">
                            <input type="hidden" name="amount[<?php 
                echo $row->id;
                ?>
]" value="<?php 
                echo esc_attr($row->amount);
                ?>
">
                        </th>
                        <td>
                            <strong><a href="<?php 
                echo admin_url('user-edit.php?user_id=' . $user_data->ID);
                ?>
"><?php 
                echo $user_data->user_login;
                ?>
</a></strong>
                            <div class="row-actions">
                                <?php 
                if ($status == 'pending') {
                    ?>

                                    <span class="edit"><a href="#" class="dokan-withdraw-action" data-status="approve" data-withdraw_id = "<?php 
                    echo $row->id;
                    ?>
"><?php 
                    _e('Approve', 'dokan');
                    ?>
</a> | </span>
                                    <span class="edit"><a href="#" class="dokan-withdraw-action" data-status="cancel" data-withdraw_id = "<?php 
                    echo $row->id;
                    ?>
"><?php 
                    _e('Cancel', 'dokan');
                    ?>
</a></span>
                                
                                <?php 
                } elseif ($status == 'completed') {
                    ?>
                                    
                                    <span class="edit"><a href="#" class="dokan-withdraw-action" data-status="cancel" data-withdraw_id = "<?php 
                    echo $row->id;
                    ?>
"><?php 
                    _e('Cancel', 'dokan');
                    ?>
</a> | </span>
                                    <span class="edit"><a href="#" class="dokan-withdraw-action" data-status="pending" data-withdraw_id = "<?php 
                    echo $row->id;
                    ?>
"><?php 
                    _e('Pending', 'dokan');
                    ?>
</a></span>

                                <?php 
                } elseif ($status == 'cancelled') {
                    ?>
                                    
                                    <span class="edit"><a href="#" class="dokan-withdraw-action" data-status="approve" data-withdraw_id = "<?php 
                    echo $row->id;
                    ?>
"><?php 
                    _e('Approve', 'dokan');
                    ?>
</a> | </span>
                                    <span class="edit"><a href="#" class="dokan-withdraw-action" data-status="pending" data-withdraw_id = "<?php 
                    echo $row->id;
                    ?>
"><?php 
                    _e('Pending', 'dokan');
                    ?>
</a></span>

                                <?php 
                }
                ?>

                                <?php 
                if ($result) {
                    ?>
                                    <span class="trash"> | <a href="#" class="dokan-withdraw-action" data-status="delete" data-withdraw_id = "<?php 
                    echo $row->id;
                    ?>
"><?php 
                    _e('Delete', 'dokan');
                    ?>
</a></span>

                                <?php 
                }
                ?>
                            </div>
                        </td>
                        <td><?php 
                echo wc_price($row->amount);
                ?>
</td>
                        <td><?php 
                echo dokan_withdraw_get_method_title($row->method);
                ?>
</td>
                        <td>
                            <?php 
                if ($row->method != 'bank') {
                    if (isset($store_info['payment'][$row->method])) {
                        echo $store_info['payment'][$row->method]['email'];
                    }
                } elseif ($row->method == 'bank') {
                    echo dokan_get_seller_bank_details($row->user_id);
                }
                ?>
                        </td>
                        <td>
                            <div class="dokan-add-note">
                                <div class="note-display">
                                    <p class="ajax_note"><?php 
                echo $row->note;
                ?>
</p>

                                    <div class="row-actions">
                                        <a href="#" class="dokan-note-field"><?php 
                _e('Add note', 'dokan');
                ?>
</a>
                                    </div>
                                </div>

                                <div class="note-form" style="display: none;">
                                    <p><input type="text" class="dokan-note-text" name="note[<?php 
                echo $row->id;
                ?>
]" value="<?php 
                echo esc_attr($row->note);
                ?>
"></p>
                                    <a class="dokan-note-submit button" data-id=<?php 
                echo $row->id;
                ?>
 href="#" ><?php 
                _e('Save', 'dokan');
                ?>
</a>
                                    <a href="#" class="dokan-note-cancel"><?php 
                _e('cancel', 'dokan');
                ?>
</a>
                                </div>
                            </div>

                        </td>
                        <td><?php 
                echo $row->ip;
                ?>
</td>
                        <td><?php 
                echo date_i18n('M j, Y g:ia', strtotime($row->date));
                ?>
</td>
                    </tr>
                    <?php 
                $count++;
            }
        } else {
            ?>
                <tr>
                    <td colspan="8">
                        <?php 
            _e('No result found', 'dokan');
            ?>
                    </td>
                </tr>
                <?php 
        }
        ?>
            </table>

            <div class="tablenav bottom">

                <div class="alignleft actions bulkactions">
                    <select name="dokan_withdraw_bulk">
                        <option value="-1" selected="selected"><?php 
        _e('Bulk Actions', 'dokan');
        ?>
</option>

                        <?php 
        if ($status == 'pending') {
            ?>

                            <option value="approve"><?php 
            _e('Approve Requests', 'dokan');
            ?>
</option>
                            <option value="cancel"><?php 
            _e('Mark as Cancelled', 'dokan');
            ?>
</option>

                        <?php 
        } elseif ($status == 'completed') {
            ?>

                            <option value="cancel"><?php 
            _e('Mark as Cancelled', 'dokan');
            ?>
</option>
                            <option value="pending"><?php 
            _e('Mark Pending', 'dokan');
            ?>
</option>

                        <?php 
        } elseif ($status == 'cancelled') {
            ?>

                            <option value="approve"><?php 
            _e('Approve Requests', 'dokan');
            ?>
</option>
                            <option value="pending"><?php 
            _e('Mark Pending', 'dokan');
            ?>
</option>

                        <?php 
        }
        ?>

                        <?php 
        if ($result) {
            ?>
                            <option value="delete"><?php 
            _e('Delete', 'dokan');
            ?>
</option>
                            <option value="paypal"><?php 
            _e('Download PayPal mass payment file', 'dokan');
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>

                    <input type="hidden" name="status_page" value="<?php 
        echo $status;
        ?>
">
                    <input type="submit" name="" id="doaction2" class="button button-primary" value="<?php 
        esc_attr_e('Apply', 'dokan');
        ?>
">
                </div>

                <?php 
        if ($result) {
            $counts = dokan_get_withdraw_count();
            $num_of_pages = ceil($counts[$status] / $limit);
            $page_links = paginate_links(array('base' => add_query_arg('paged', '%#%'), 'format' => '', 'prev_text' => __('&laquo;', 'aag'), 'next_text' => __('&raquo;', 'aag'), 'total' => $num_of_pages, 'current' => $pagenum));
            if ($page_links) {
                echo '<div class="tablenav-pages">' . $page_links . '</div>';
            }
        }
        ?>
            </div>

        </form>
        <?php 
        $ajax_url = admin_url('admin-ajax.php');
        ?>
        <style type="text/css">
            .withdraw-table {
                margin-top: 10px;
            }

            .withdraw-table td, .withdraw-table th {
                vertical-align: top;
            }

            .custom-spinner {
                background: url('images/spinner-2x.gif') no-repeat;
                background-position: 43% 9px;
                background-size: 20px 20px;
                opacity: .4;
                filter: alpha(opacity=40);
                width: 20px;
                height: 20px;
            }
        </style>
        <script>
            (function($){
                $(document).ready(function(){
                    var url = "<?php 
        echo $ajax_url;
        ?>
";

                    $('#dokan-admin-withdraw-action').on('click', 'a.dokan-withdraw-action', function(e) {
                        e.preventDefault();
                        var self = $(this);

                        self.closest( 'tr' ).addClass('custom-spinner');
                        data = {
                            action: 'dokan_withdraw_form_action',
                            formData : $('#dokan-admin-withdraw-action').serialize(),
                            status: self.data('status') ,
                            withdraw_id : self.data( 'withdraw_id' )   
                        }

                        $.post(url, data, function( resp ) {

                            if( resp.success ) {
                                self.closest( 'tr' ).removeClass('custom-spinner');
                                window.location = resp.data.url;
                            } else {
                                self.closest( 'tr' ).removeClass('custom-spinner');    
                                alert( 'Somthig wrong...!!!' );
                            }
                        });

                    }); 
                });
            })(jQuery)
        </script>
        <?php 
        $this->add_note_script();
    }
Beispiel #20
0
 /**
  * Create a nicely formatted and more specific title element text for output
  * in head of document, based on current view.
  *
  * @since Dokan 1.0.4
  *
  * @param string  $title Default title text for current view.
  * @param string  $sep   Optional separator.
  *
  * @return string The filtered title.
  */
 function wp_title($title, $sep)
 {
     global $paged, $page;
     if (is_feed()) {
         return $title;
     }
     if (dokan_is_store_page()) {
         $site_title = get_bloginfo('name');
         $store_user = get_userdata(get_query_var('author'));
         $store_info = dokan_get_store_info($store_user->ID);
         $store_name = esc_html($store_info['store_name']);
         $title = "{$store_name} {$sep} {$site_title}";
         // Add a page number if necessary.
         if ($paged >= 2 || $page >= 2) {
             $title = "{$title} {$sep} " . sprintf(__('Page %s', 'dokan'), max($paged, $page));
         }
         return $title;
     }
     return $title;
 }
    function setting_field($validate = '')
    {
        global $current_user;
        if (isset($_GET['message'])) {
            ?>
            <div class="alert alert-success">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                <strong><?php 
            _e('Your profile has been updated successfully!', 'dokan');
            ?>
</strong>
            </div>
            <?php 
        }
        $profile_info = dokan_get_store_info($current_user->ID);
        $banner = isset($profile_info['banner']) ? absint($profile_info['banner']) : 0;
        $storename = isset($profile_info['store_name']) ? esc_attr($profile_info['store_name']) : '';
        $gravatar = isset($profile_info['gravatar']) ? absint($profile_info['gravatar']) : 0;
        $fb = isset($profile_info['social']['fb']) ? esc_url($profile_info['social']['fb']) : '';
        $twitter = isset($profile_info['social']['twitter']) ? esc_url($profile_info['social']['twitter']) : '';
        $gplus = isset($profile_info['social']['gplus']) ? esc_url($profile_info['social']['gplus']) : '';
        $linkedin = isset($profile_info['social']['linkedin']) ? esc_url($profile_info['social']['linkedin']) : '';
        $youtube = isset($profile_info['social']['youtube']) ? esc_url($profile_info['social']['youtube']) : '';
        // bank
        $phone = isset($profile_info['phone']) ? esc_attr($profile_info['phone']) : '';
        $show_email = isset($profile_info['show_email']) ? esc_attr($profile_info['show_email']) : 'no';
        $address = isset($profile_info['address']) ? esc_textarea($profile_info['address']) : '';
        $map_location = isset($profile_info['location']) ? esc_attr($profile_info['location']) : '';
        $map_address = isset($profile_info['find_address']) ? esc_attr($profile_info['find_address']) : '';
        $dokan_category = isset($profile_info['dokan_category']) ? $profile_info['dokan_category'] : '';
        if (is_wp_error($validate)) {
            $social = $_POST['settings']['social'];
            $storename = $_POST['dokan_store_name'];
            $fb = esc_url($social['fb']);
            $twitter = esc_url($social['twitter']);
            $gplus = esc_url($social['gplus']);
            $linkedin = esc_url($social['linkedin']);
            $youtube = esc_url($social['youtube']);
            $phone = $_POST['setting_phone'];
            $address = $_POST['setting_address'];
            $map_location = $_POST['location'];
            $map_address = $_POST['find_address'];
        }
        ?>

            <div class="dokan-ajax-response"></div>

            <form method="post" id="settings-form"  action="" class="form-horizontal">

                <?php 
        wp_nonce_field('dokan_settings_nonce');
        ?>

                <div class="dokan-banner">

                    <div class="image-wrap<?php 
        echo $banner ? '' : ' dokan-hide';
        ?>
">
                        <?php 
        $banner_url = $banner ? wp_get_attachment_url($banner) : '';
        ?>
                        <input type="hidden" class="dokan-file-field" value="<?php 
        echo $banner;
        ?>
" name="dokan_banner">
                        <img class="dokan-banner-img" src="<?php 
        echo esc_url($banner_url);
        ?>
">

                        <a class="close dokan-remove-banner-image">&times;</a>
                    </div>

                    <div class="button-area<?php 
        echo $banner ? ' dokan-hide' : '';
        ?>
">
                        <i class="fa fa-cloud-upload"></i>

                        <a href="#" class="dokan-banner-drag btn btn-info"><?php 
        _e('Upload banner', 'dokan');
        ?>
</a>
                        <p class="help-block"><?php 
        _e('(Upload a banner for your store. Banner size is (825x300) pixel. )', 'dokan');
        ?>
</p>
                    </div>
                </div> <!-- .dokan-banner -->


                <div class="form-group">
                    <label class="col-md-3 control-label" for="dokan_store_name"><?php 
        _e('Store Name', 'dokan');
        ?>
</label>

                    <div class="col-md-5">
                        <input id="dokan_store_name" required value="<?php 
        echo $storename;
        ?>
" name="dokan_store_name" placeholder="store name" class="form-control input-md" type="text">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label" for="dokan_gravatar"><?php 
        _e('Profile Picture', 'dokan');
        ?>
</label>

                    <div class="col-md-5 dokan-gravatar">
                        <div class="pull-left gravatar-wrap<?php 
        echo $gravatar ? '' : ' dokan-hide';
        ?>
">
                            <?php 
        $gravatar_url = $gravatar ? wp_get_attachment_url($gravatar) : '';
        ?>
                            <input type="hidden" class="dokan-file-field" value="<?php 
        echo $gravatar;
        ?>
" name="dokan_gravatar">
                            <img class="dokan-gravatar-img" src="<?php 
        echo esc_url($gravatar_url);
        ?>
">
                            <a class="close dokan-remove-gravatar-image">&times;</a>
                        </div>
                        <div class="gravatar-button-area<?php 
        echo $gravatar ? ' dokan-hide' : '';
        ?>
">
                            <i class="fa fa-cloud-upload"></i>

                            <a href="#" class="dokan-gravatar-drag btn btn-info"><?php 
        _e('Upload Photo', 'dokan');
        ?>
</a>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label" for="settings[social][fb]"><?php 
        _e('Social Profile', 'dokan');
        ?>
</label>

                    <div class="col-md-5">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-facebook-square"></i></span>
                            <input id="settings[social][fb]" value="<?php 
        echo $fb;
        ?>
" name="settings[social][fb]" class="form-control" placeholder="http://" type="text">
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label" for="settings[social][plus]"></label>
                    <div class="col-md-5">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-google-plus"></i></span>
                            <input id="settings[social][gplus]" value="<?php 
        echo $gplus;
        ?>
" name="settings[social][gplus]" class="form-control" placeholder="http://" type="text">
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label" for="settings[social][twitter]"></label>
                    <div class="col-md-5">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-twitter"></i></span>
                            <input id="settings[social][twitter]" value="<?php 
        echo $twitter;
        ?>
" name="settings[social][twitter]" class="form-control" placeholder="http://" type="text">
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label" for="settings[social][linkedin]"></label>
                    <div class="col-md-5">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-linkedin"></i></span>
                            <input id="settings[social][linkedin]" value="<?php 
        echo $linkedin;
        ?>
" name="settings[social][linkedin]" class="form-control" placeholder="http://" type="text">
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label" for="settings[social][youtube]"></label>
                    <div class="col-md-5">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-youtube"></i></span>
                            <input id="settings[social][youtube]" value="<?php 
        echo $youtube;
        ?>
" name="settings[social][youtube]" class="form-control" placeholder="http://" type="text">
                        </div>
                    </div>
                </div>

                <!-- payment tab -->
                <div class="form-group">
                    <label class="col-md-3 control-label" for="dokan_setting"><?php 
        _e('Payment Method', 'dokan');
        ?>
</label>
                    <div class="col-md-6">

                        <?php 
        $methods = dokan_withdraw_get_active_methods();
        ?>

                        <ul class="nav nav-tabs" style="margin-bottom: 10px;">
                            <?php 
        $count = 0;
        foreach ($methods as $method_key) {
            $method = dokan_withdraw_get_method($method_key);
            ?>
                                <li<?php 
            echo $count == 0 ? ' class="active"' : '';
            ?>
><a href="#dokan-payment-<?php 
            echo $method_key;
            ?>
" data-toggle="tab"><?php 
            echo $method['title'];
            ?>
</a></li>
                                <?php 
            $count++;
        }
        ?>
                        </ul>

                        <!-- Tab panes -->
                        <div class="tab-content">

                            <?php 
        $count = 0;
        foreach ($methods as $method_key) {
            $method = dokan_withdraw_get_method($method_key);
            ?>
                                <div class="tab-pane<?php 
            echo $count == 0 ? ' active' : '';
            ?>
" id="dokan-payment-<?php 
            echo $method_key;
            ?>
">
                                    <?php 
            if (is_callable($method['callback'])) {
                call_user_func($method['callback'], $profile_info);
            }
            ?>
                                </div>

                                <?php 
            $count++;
        }
        ?>
                        </div> <!-- .tab-content -->

                    </div> <!-- .col-md-4 -->
                </div> <!-- .form-group -->

                <div class="form-group">
                    <label class="col-md-3 control-label" for="setting_phone"><?php 
        _e('Phone No', 'dokan');
        ?>
</label>
                    <div class="col-md-5">
                        <input id="setting_phone" value="<?php 
        echo $phone;
        ?>
" name="setting_phone" placeholder="+123456.." class="form-control input-md" type="text">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label" for="setting_phone"><?php 
        _e('Email', 'dokan');
        ?>
</label>
                    <div class="col-md-5">
                        <div class="checkbox">
                            <label>
                                <input type="hidden" name="setting_show_email" value="no">
                                <input type="checkbox" name="setting_show_email" value="yes"<?php 
        checked($show_email, 'yes');
        ?>
> <?php 
        _e('Show email address in store', 'dokan');
        ?>
                            </label>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label" for="setting_address"><?php 
        _e('Address', 'dokan');
        ?>
</label>
                    <div class="col-md-5">
                        <textarea class="form-control" rows="4" id="setting_address" name="setting_address"><?php 
        echo $address;
        ?>
</textarea>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label" for="setting_map"><?php 
        _e('Map', 'dokan');
        ?>
</label>

                    <div class="col-md-4">
                        <input id="dokan-map-lat" type="hidden" name="location" value="<?php 
        echo $map_location;
        ?>
" size="30" />

                        <div class="input-group">
                            <span class="input-group-btn">
                                <input id="dokan-map-add" type="text" class="form-control" value="<?php 
        echo $map_address;
        ?>
" name="find_address" placeholder="<?php 
        _e('Type an address to find', 'dokan');
        ?>
" size="30" />
                                <a href="#" class="btn btn-default" id="dokan-location-find-btn" type="button"><?php 
        _e('Find Address', 'dokan');
        ?>
</a>
                            </span>
                        </div><!-- /input-group -->

                        <div class="dokan-google-map" id="dokan-map"></div>
                    </div> <!-- col.md-4 -->
                </div> <!-- .form-group -->

                <div class="form-group">
                    <label class="col-md-3 control-label" for="dokan_setting"></label>

                    <div class="col-md-4 ajax_prev">
                        <input type="submit" name="dokan_update_profile" class="btn btn-primary" value="<?php 
        esc_attr_e('Update Settings', 'dokan');
        ?>
">
                    </div>
                </div>

            </form>

                <script type="text/javascript">

                    (function($) {
                        $(function() {
                            <?php 
        $locations = explode(',', $map_location);
        $def_lat = isset($locations[0]) ? $locations[0] : 90.40714300000002;
        $def_long = isset($locations[1]) ? $locations[1] : 23.709921;
        ?>
                            var def_zoomval = 12;
                            var def_longval = '<?php 
        echo $def_long;
        ?>
';
                            var def_latval = '<?php 
        echo $def_lat;
        ?>
';
                            var curpoint = new google.maps.LatLng(def_latval, def_longval),
                                geocoder   = new window.google.maps.Geocoder(),
                                $map_area = $('#dokan-map'),
                                $input_area = $( '#dokan-map-lat' ),
                                $input_add = $( '#dokan-map-add' ),
                                $find_btn = $( '#dokan-location-find-btn' );

                            autoCompleteAddress();

                            $find_btn.on('click', function(e) {
                                e.preventDefault();

                                geocodeAddress( $input_add.val() );
                            });

                            var gmap = new google.maps.Map( $map_area[0], {
                                center: curpoint,
                                zoom: def_zoomval,
                                mapTypeId: window.google.maps.MapTypeId.ROADMAP
                            });

                            var marker = new window.google.maps.Marker({
                                position: curpoint,
                                map: gmap,
                                draggable: true
                            });

                            window.google.maps.event.addListener( gmap, 'click', function ( event ) {
                                marker.setPosition( event.latLng );
                                updatePositionInput( event.latLng );
                            } );

                            window.google.maps.event.addListener( marker, 'drag', function ( event ) {
                                updatePositionInput(event.latLng );
                            } );

                            function updatePositionInput( latLng ) {
                                $input_area.val( latLng.lat() + ',' + latLng.lng() );
                            }

                            function updatePositionMarker() {
                                var coord = $input_area.val(),
                                    pos, zoom;

                                if ( coord ) {
                                    pos = coord.split( ',' );
                                    marker.setPosition( new window.google.maps.LatLng( pos[0], pos[1] ) );

                                    zoom = pos.length > 2 ? parseInt( pos[2], 10 ) : 12;

                                    gmap.setCenter( marker.position );
                                    gmap.setZoom( zoom );
                                }
                            }

                            function geocodeAddress( address ) {
                                geocoder.geocode( {'address': address}, function ( results, status ) {
                                    if ( status == window.google.maps.GeocoderStatus.OK ) {
                                        updatePositionInput( results[0].geometry.location );
                                        marker.setPosition( results[0].geometry.location );
                                        gmap.setCenter( marker.position );
                                        gmap.setZoom( 15 );
                                    }
                                } );
                            }

                            function autoCompleteAddress(){
                                if (!$input_add) return null;

                                $input_add.autocomplete({
                                    source: function(request, response) {
                                        // TODO: add 'region' option, to help bias geocoder.
                                        geocoder.geocode( {'address': request.term }, function(results, status) {
                                            response(jQuery.map(results, function(item) {
                                                return {
                                                    label     : item.formatted_address,
                                                    value     : item.formatted_address,
                                                    latitude  : item.geometry.location.lat(),
                                                    longitude : item.geometry.location.lng()
                                                };
                                            }));
                                        });
                                    },
                                    select: function(event, ui) {

                                        $input_area.val(ui.item.latitude + ',' + ui.item.longitude );

                                        var location = new window.google.maps.LatLng(ui.item.latitude, ui.item.longitude);

                                        gmap.setCenter(location);
                                        // Drop the Marker
                                        setTimeout( function(){
                                            marker.setValues({
                                                position    : location,
                                                animation   : window.google.maps.Animation.DROP
                                            });
                                        }, 1500);
                                    }
                                });
                            }

                        });
                    })(jQuery);
                </script>

                <script type="text/javascript">

                    jQuery(function($){
                        // $('#setting_category').chosen({
                        //     width: "95%"
                        // }).change(function() {
                        //     $("form#settings-form").validate().element("#setting_category");
                        // });
                    })

                </script>

        <?php 
    }
/**
 * Get seller bank details
 *
 * @param int $seller_id
 * @return string
 */
function dokan_get_seller_bank_details($seller_id)
{
    $info = dokan_get_store_info($seller_id);
    $payment = $info['payment']['bank'];
    $details = array();
    if (isset($payment['ac_name'])) {
        $details[] = sprintf(__('Account Name: %s', 'dokan'), $payment['ac_name']);
    }
    if (isset($payment['ac_number'])) {
        $details[] = sprintf(__('Account Number: %s', 'dokan'), $payment['ac_number']);
    }
    if (isset($payment['bank_name'])) {
        $details[] = sprintf(__('Bank Name: %s', 'dokan'), $payment['bank_name']);
    }
    if (isset($payment['bank_addr'])) {
        $details[] = sprintf(__('Address: %s', 'dokan'), $payment['bank_addr']);
    }
    if (isset($payment['swift'])) {
        $details[] = sprintf(__('SWIFT: %s', 'dokan'), $payment['swift']);
    }
    return nl2br(implode("\n", $details));
}
<?php

$store_user = get_userdata(get_query_var('author'));
$store_info = dokan_get_store_info($store_user->ID);
$store_tabs = dokan_get_store_tabs($store_user->ID);
$social_fields = dokan_get_social_profile_fields();
?>
<div class="profile-frame">

    <?php 
if (isset($store_info['banner']) && !empty($store_info['banner'])) {
    ?>
    <style type="text/css">
        .profile-frame {
            background-image: url('<?php 
    echo wp_get_attachment_url($store_info['banner']);
    ?>
');
        }
    </style>
    <?php 
}
?>

    <div class="profile-info-box">
        <div class="profile-img">
            <?php 
echo get_avatar($store_user->ID, 80);
?>
        </div>
Beispiel #24
0
    function setting_field($validate = '')
    {
        global $current_user;
        require_once 'template-agreement.php';
        if (isset($_GET['message'])) {
            ?>
            <div class="dokan-alert dokan-alert-success">
                <button type="button" class="dokan-close" data-dismiss="alert">&times;</button>
                <strong><?php 
            _e('Your profile has been updated successfully!', 'dokan');
            ?>
</strong>
            </div>
            <?php 
        }
        $profile_info = dokan_get_store_info($current_user->ID);
        $legal_stat = isset($profile_info['legal_stat']) ? esc_attr($profile_info['legal_stat']) : esc_attr($profile_info['legal_stat']);
        $firm_name = isset($profile_info['firm_name']) ? esc_attr($profile_info['firm_name']) : esc_attr($profile_info['firm_name']);
        //Office Address
        $add_line_1 = isset($profile_info['add_line_1']) ? esc_textarea($profile_info['add_line_1']) : esc_textarea($profile_info['add_line_1']);
        $add_line_2 = isset($profile_info['add_line_2']) ? esc_textarea($profile_info['add_line_2']) : esc_textarea($profile_info['add_line_2']);
        $pin_code = isset($profile_info['pin_code']) ? esc_textarea($profile_info['pin_code']) : esc_textarea($profile_info['pin_code']);
        $state = isset($profile_info['state']) ? esc_textarea($profile_info['state']) : esc_textarea($profile_info['state']);
        $city = isset($profile_info['city']) ? esc_textarea($profile_info['city']) : esc_textarea($profile_info['city']);
        $full_address = $address . ', ' . $add_line_2 . ', ' . $city . '-' . $pin_code . ', ' . $state;
        //Pickup Address
        $padd_line_1 = isset($profile_info['padd_line_1']) ? esc_textarea($profile_info['padd_line_1']) : esc_textarea($profile_info['padd_line_1']);
        $padd_line_2 = isset($profile_info['padd_line_2']) ? esc_textarea($profile_info['padd_line_2']) : esc_textarea($profile_info['padd_line_2']);
        $ppin_code = isset($profile_info['ppin_code']) ? esc_textarea($profile_info['ppin_code']) : esc_textarea($profile_info['ppin_code']);
        $pstate = isset($profile_info['pstate']) ? esc_textarea($profile_info['pstate']) : esc_textarea($profile_info['pstate']);
        $pcity = isset($profile_info['pcity']) ? esc_textarea($profile_info['pcity']) : esc_textarea($profile_info['pcity']);
        $pfull_address = $paddress . ', ' . $padd_line_2 . ', ' . $pcity . '-' . $ppin_code . ', ' . $pstate;
        $pan_no = isset($profile_info['pan_no']) ? esc_textarea($profile_info['pan_no']) : esc_textarea($profile_info['pan_no']);
        $vat_no = isset($profile_info['vat_no']) ? esc_textarea($profile_info['vat_no']) : esc_textarea($profile_info['vat_no']);
        $setting_phone = isset($profile_info['billing_phone']) ? esc_attr($profile_info['billing_phone']) : esc_attr($profile_info['billing_phone']);
        $bus_cat = isset($profile_info['bus_cat']) ? esc_textarea($profile_info['bus_cat']) : esc_textarea($profile_info['bus_cat']);
        $plans = isset($profile_info['plans']) ? esc_textarea($profile_info['plans']) : esc_textarea($profile_info['plans']);
        $full_name = isset($profile_info['full_name']) ? esc_attr($profile_info['full_name']) : esc_attr($profile_info['full_name']);
        $agreement1 = isset($profile_info['agreement1']) ? esc_attr($profile_info['agreement1']) : 'no';
        $mou = isset($profile_info['mou']) ? esc_attr($profile_info['mou']) : 'no';
        $toa = isset($profile_info['toa']) ? esc_attr($profile_info['toa']) : esc_attr($profile_info['toa']);
        $sfp = isset($profile_info['sfp']) ? esc_attr($profile_info['sfp']) : esc_attr($profile_info['sfp']);
        if ($agreement1 == 'yes') {
            $disabled = 'readonly';
        }
        $banner = isset($profile_info['banner']) ? absint($profile_info['banner']) : 0;
        $storename = isset($profile_info['store_name']) ? esc_attr($profile_info['store_name']) : '';
        $gravatar = isset($profile_info['gravatar']) ? absint($profile_info['gravatar']) : 0;
        $fb = isset($profile_info['social']['fb']) ? esc_url($profile_info['social']['fb']) : '';
        $twitter = isset($profile_info['social']['twitter']) ? esc_url($profile_info['social']['twitter']) : '';
        $gplus = isset($profile_info['social']['gplus']) ? esc_url($profile_info['social']['gplus']) : '';
        $linkedin = isset($profile_info['social']['linkedin']) ? esc_url($profile_info['social']['linkedin']) : '';
        $youtube = isset($profile_info['social']['youtube']) ? esc_url($profile_info['social']['youtube']) : '';
        // bank
        $show_email = isset($profile_info['show_email']) ? esc_attr($profile_info['show_email']) : 'no';
        $map_location = isset($profile_info['location']) ? esc_attr($profile_info['location']) : '';
        $map_address = isset($profile_info['find_address']) ? esc_attr($profile_info['find_address']) : '';
        $dokan_category = isset($profile_info['dokan_category']) ? $profile_info['dokan_category'] : '';
        if (is_wp_error($validate)) {
            $social = $_POST['settings']['social'];
            $storename = $_POST['dokan_store_name'];
            $fb = esc_url($social['fb']);
            $twitter = esc_url($social['twitter']);
            $gplus = esc_url($social['gplus']);
            $linkedin = esc_url($social['linkedin']);
            $youtube = esc_url($social['youtube']);
            $phone = $_POST['billing_phone'];
            $address = $_POST['setting_address'];
            $map_location = $_POST['location'];
            $map_address = $_POST['find_address'];
        }
        //Custom query
        //$shipping_postcode = get_user_meta( $current_user->ID, 'billing_city', true );
        /*Custom Shortcode */
        $billing_company = get_user_meta(get_current_user_id(), 'billing_company', true);
        $billing_add1 = get_user_meta(get_current_user_id(), 'billing_address_1', true);
        $billing_add2 = get_user_meta(get_current_user_id(), 'billing_address_2', true);
        $billing_postcode = get_user_meta(get_current_user_id(), 'billing_postcode', true);
        $billing_city = get_user_meta(get_current_user_id(), 'billing_city', true);
        $billing_state = get_user_meta(get_current_user_id(), 'billing_state', true);
        $shipping_company = get_user_meta(get_current_user_id(), 'shipping_company', true);
        $shipping_add1 = get_user_meta(get_current_user_id(), 'shipping_address_1', true);
        $shipping_add2 = get_user_meta(get_current_user_id(), 'shipping_address_2', true);
        $shipping_postcode = get_user_meta(get_current_user_id(), 'shipping_postcode', true);
        $shipping_city = get_user_meta(get_current_user_id(), 'shipping_city', true);
        $shipping_state = get_user_meta(get_current_user_id(), 'shipping_state', true);
        function agree_add()
        {
            return '<span id="agreement_address"><span id="add_line_1_t">' . get_user_meta(get_current_user_id(), 'billing_address_1', true) . '</span>,<span id="add_line_2_t">' . get_user_meta(get_current_user_id(), 'billing_address_2', true) . '</span>,<span>' . get_user_meta(get_current_user_id(), 'billing_city', true) . ',' . get_user_meta(get_current_user_id(), 'billing_state', true) . '</span><span id="pin_code_t">' . get_user_meta(get_current_user_id(), 'billing_postcode', true) . '</span></span>';
        }
        add_shortcode('agreement_address', 'agree_add');
        function agree_firm()
        {
            $dokan_info = get_user_meta(get_current_user_id(), 'dokan_profile_settings', true);
            return '<span id="agreement_name">' . get_user_meta(get_current_user_id(), 'billing_company', true) . ' (PAN:' . $dokan_info['pan_no'] . ')</span>';
        }
        add_shortcode('agreement_name', 'agree_firm');
        ?>
<div class="dokan-ajax-response"></div>
<form method="post" id="settings-form"  action="" class="dokan-form-horizontal">
<script>
jQuery(function($) {
  $("#firm_name").keyup(function(){
    var text = this.value;
	document.getElementById('agreement_name').innerHTML= text;
  });
  $("#add_line_1").keyup(function(){
    var text = this.value;
	document.getElementById('add_line_1_t').innerHTML= text;
  });
  $("#add_line_2").keyup(function(){
    var text = this.value;
	document.getElementById('add_line_2_t').innerHTML= text;
  });
  $("#pin_code").keyup(function(){
    var text = this.value;
	document.getElementById('pin_code_t').innerHTML= text;
  });
  $("#state").change(function(){
    var text = $("#city").val()+','+this.value;
	$('#agreement_address span:last-child').text(text);
  });
  $("#city").change(function(){
    var text = this.value+','+$("#state").val();
	$('#agreement_address span:last-child').text(text);
  });
  $("#pan_no").keyup(function(){
    var text = $("#firm_name").val()+' (PAN:'+this.value+')';
	$('#agreement_name').text(text);
  });
});
</script>
<?php 
        $disable = "readonly";
        wp_nonce_field('dokan_settings_nonce');
        ?>
 
    <div class="step_form_settings">
      <h3>Seller Agreement</h3>
      <section>
        <div class="row">
          <div class="col-md-6">
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="legal_stat">
                <?php 
        _e('Legal Status', 'dokan');
        ?>
           
                <a type="button" class="btn btn-default cust_tool" data-toggle="tooltip" data-placement="bottom" title="Choose Your Business Type">?</a>
              </label>
              <div class="col-md-8">
                <?php 
        if (!empty($legal_stat) && $agreement1 == 'yes') {
            ?>
                
                <input id="legal_stat" required value="<?php 
            echo $legal_stat;
            ?>
" <?php 
            echo $disable;
            ?>
 name="legal_stat" class="form-control input-md" type="text">
                <?php 
        } else {
            ?>
                
                <select id="legal_stat" name="legal_stat" class="form-control input-md" required>
                  <option value="Individual">Individual</option>
                  <option value="Partnership Firm">Partnership Firm</option>
                  <option value="Proprietorship Firm">Proprietorship Firm</option>
                  <option value="A Company">A Company</option>
                </select>                
                <?php 
        }
        ?>
              </div>
            </div>              
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="firm_name">
                <?php 
        _e('Individual / Firm Name', 'dokan');
        ?>
                <a type="button" class="btn btn-default cust_tool" data-toggle="tooltip" data-placement="bottom" title="Name of your business or Your Name in case of Individual">?</a>
              </label>
              <div class="col-md-8">
                <input id="firm_name" required value="<?php 
        echo $billing_company;
        ?>
" name="firm_name" placeholder="Firm Name" class="form-control input-md" type="text" <?php 
        echo $billing_company ? $disable : '';
        ?>
>            
              </div>
            </div>
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="add_line_1">
                <?php 
        _e('Office Address', 'dokan');
        ?>
    
                <a type="button" class="btn btn-default cust_tool" data-toggle="tooltip" data-placement="bottom" title="This will be you office Address.">?</a>            
              </label>
              <div class="col-md-8">
                <input id="add_line_1" required value="<?php 
        echo $billing_add1;
        ?>
" name="add_line_1" placeholder="Address Line 1" class="form-control input-md" type="text" <?php 
        echo $billing_add1 ? $disable : '';
        ?>
>            
              </div>
            </div>
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="add_line_2">
                <?php 
        _e('&nbsp;', 'dokan');
        ?>
                
              </label>
              <div class="col-md-8">
                <input id="add_line_2" required value="<?php 
        echo $billing_add2;
        ?>
" name="add_line_2" placeholder="Address Line 2" class="form-control input-md" type="text" <?php 
        echo $billing_add2 ? $disable : '';
        ?>
>            
              </div>
            </div> 
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="pin_code">
                <?php 
        _e('Pin Code', 'dokan');
        ?>
                
              </label>
              <div class="col-md-8">
                <input id="pin_code" required value="<?php 
        echo $billing_postcode;
        ?>
" name="pin_code" placeholder="Pin Code" class="form-control input-md" type="text" <?php 
        echo $billing_postcode ? $disable : '';
        ?>
>            
              </div>
            </div>
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="state">
                <?php 
        _e('State', 'dokan');
        ?>
              </label>
              <div class="col-md-8">
              <?php 
        $userpro = get_option('userpro_fields');
        $states = implode('","', $userpro['billing_state']['options']);
        $cities = implode('","', $userpro['billing_city']['options']);
        ?>
                <?php 
        if ($billing_state == '') {
            ?>
                <select id="state" required class="form-control input-md" name="state">
                <script language="javascript">
                var states = new Array(<?php 
            echo '"' . $states . '"';
            ?>
);
				document.write("<option value='' selected='selected'>Select State:</option>");
                for(var hi=0; hi<states.length; hi++)
                	document.write("<option value=\""+states[hi]+"\">"+states[hi]+"</option>");
				</script>
                </select>
                <?php 
        } else {
            ?>
                <input id="state" value="<?php 
            echo $billing_state;
            ?>
" name="state" placeholder="State" class="form-control input-md" type="text" <?php 
            echo $billing_state ? $disable : '';
            ?>
>  
                <?php 
        }
        ?>
              </div>
            </div>
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="city">
                <?php 
        _e('City', 'dokan');
        ?>
              </label>
              <div class="col-md-8">
                <?php 
        if ($billing_city == '') {
            ?>
                <select required id="city" class="form-control input-md" name="city">
                <script language="javascript">
                var cities = new Array(<?php 
            echo '"' . $cities . '"';
            ?>
);
				document.write("<option value='' selected='selected'>Select City:</option>");
                for(var hi=0; hi<cities.length; hi++)
					document.write("<option value=\""+cities[hi]+"\">"+cities[hi]+"</option>");
                </script>
                </select>
                <?php 
        } else {
            ?>
                <input id="city" value="<?php 
            echo $billing_city;
            ?>
" name="city" placeholder="City" class="form-control input-md" type="text" <?php 
            echo $billing_city ? $disable : '';
            ?>
>  
                <?php 
        }
        ?>
              </div>
            </div>               
          </div>
          <div class="col-md-6">            
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="firm_name">
                <?php 
        _e('PAN Number *', 'dokan');
        ?>
              </label>
              <div class="col-md-8">
                <input id="pan_no" required value="<?php 
        echo $pan_no;
        ?>
" name="pan_no" placeholder="PAN Number" class="form-control input-md" type="text" <?php 
        echo $pan_no ? $disable : '';
        ?>
>            
              </div>
            </div>
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="firm_name">
                <?php 
        _e('VAT Number', 'dokan');
        ?>
              </label>
              <div class="col-md-8">
                <input id="vat_no" value="<?php 
        echo $vat_no;
        ?>
" name="vat_no" placeholder="VAT Number" class="form-control input-md" type="text" <?php 
        echo $vat_no ? $disable : '';
        ?>
>
              </div>
            </div>            
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="bus_cat">
                <?php 
        _e('Business Category', 'dokan');
        ?>
              </label>
              <div class="col-md-8">
                <?php 
        if (!empty($city) && $agreement1 == 'yes') {
            ?>
                <?php 
            $theCatId = get_term_by('slug', $bus_cat, 'product_cat');
            ?>
                <input id="bus_cat" value="<?php 
            echo $theCatId->name;
            ?>
" name="bus_cat" class="form-control input-md" type="text" <?php 
            echo $theCatId->name ? $disable : '';
            ?>
>
                <?php 
        } else {
            ?>
                <select id="bus_cat" name="bus_cat" class="form-control input-md" required>
                  <?php 
            $args = array('orderby' => 'name', 'order' => 'ASC');
            $product_categories = get_terms('product_cat', $args);
            foreach ($product_categories as $cat) {
                if (0 == $cat->parent) {
                    echo '<option value="' . $cat->slug . '"', $bus_cat == $cat->slug ? ' selected="selected"' : '', '>', $cat->name, '</option>';
                }
            }
            ?>
                </select>
                <?php 
        }
        ?>
              </div>
            </div>
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="add_line_1">
                <?php 
        _e('Pickup Address', 'dokan');
        ?>
    
                <a type="button" class="btn btn-default cust_tool" data-toggle="tooltip" data-placement="bottom" title="This will be you Pickup Address from where the products will be picked up">?</a>            
              </label>
              <div class="col-md-8">
                <input id="add_line_1" required value="<?php 
        echo $shipping_add1;
        ?>
" name="padd_line_1" placeholder="Address Line 1" class="form-control input-md" type="text" <?php 
        echo $shipping_add1 ? $disable : '';
        ?>
>            
              </div>
            </div>
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="add_line_2">
                <?php 
        _e('&nbsp;', 'dokan');
        ?>
                
              </label>
              <div class="col-md-8">
                <input id="add_line_2" required value="<?php 
        echo $shipping_add2;
        ?>
" name="padd_line_2" placeholder="Address Line 2" class="form-control input-md" type="text" <?php 
        echo $shipping_add2 ? $disable : '';
        ?>
>            
              </div>
            </div> 
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="pin_code">
                <?php 
        _e('Pin Code', 'dokan');
        ?>
                
              </label>
              <div class="col-md-8">
                <input id="pin_code" required value="<?php 
        echo $shipping_postcode;
        ?>
" name="ppin_code" placeholder="Pin Code" class="form-control input-md" type="text" <?php 
        echo $shipping_postcode ? $disable : '';
        ?>
>            
              </div>
            </div>
            <div class="form-group" style="text-align:right">
            <style>.wpo-wrapper.test-style2_dw > option { display: none !important; }</style>
              <label class="col-md-4 control-label" for="pstate">
                <?php 
        _e('State', 'dokan');
        ?>
              </label>
              <div class="col-md-8">
                <?php 
        if ($shipping_state == '') {
            ?>
                        <script>var stt = new Array();</script>
						<?php 
            global $wpdb;
            $mycity = $wpdb->prefix . "mycity";
            $states = $wpdb->get_results("select distinct(state) from `{$mycity}` order by state asc");
            foreach ($states as $s) {
                $citiess = '';
                $cities = $wpdb->get_results("select distinct(name) from `{$mycity}` where state='{$s->state}' order by name asc");
                $statess .= '"' . $s->state . '",';
                foreach ($cities as $c) {
                    $citiess .= $c->name . ',';
                }
                $citiess = rtrim($citiess, ',');
                ?>
                            <script>
                            stt['<?php 
                echo $s->state;
                ?>
']='<?php 
                echo $citiess;
                ?>
';
                            </script>
                            <?php 
            }
            $statess = rtrim($statess, ',');
            ?>
				<select id="pstate" class="form-control input-md" name="pstate">
                    <option value="">Select State:</option>
                    <script language="javascript">
                    var states = new Array(<?php 
            echo $statess;
            ?>
);
                    for(var hi=0; hi<states.length; hi++)
                    document.write("<option value=\""+states[hi]+"\">"+states[hi]+"</option>");
                    </script>
                </select>
                <?php 
        } else {
            ?>
                <input id="pstate" required value="<?php 
            echo $shipping_state;
            ?>
" name="pstate" placeholder="State" class="form-control input-md" type="text" <?php 
            echo $disable;
            ?>
>  
                <?php 
        }
        ?>
              </div>
            </div>
            <div class="form-group" style="text-align:right">
              <label class="col-md-4 control-label" for="pcity">
                <?php 
        _e('City', 'dokan');
        ?>
              </label>
              <div class="col-md-8">
                <?php 
        if ($shipping_city == '') {
            ?>
                <select id="pcity" class="form-control input-md" name="pcity">
                
                </select>
                        <script>
						console.log(stt);
						jQuery(document).ready(function() {
							jQuery('#pstate').change(function(){
							jQuery('#pcity').html('');
							var st = jQuery(this).val();
							if(st==''){
								jQuery('#pcity').html('<option val="">Select City</option>');
							} else {
								var s = stt[st].split(",");
								for (var i=0; i<s.length; i++) {
									jQuery('#pcity').append('<option val="'+s[i]+'">'+s[i]+'</option>');
								}
							}
							});
						});
						</script>
                <?php 
        } else {
            ?>
                <input id="pcity" required value="<?php 
            echo $shipping_city;
            ?>
" name="pcity" placeholder="City" class="form-control input-md" type="text" <?php 
            echo $disable;
            ?>
>  
                <?php 
        }
        ?>
              </div>
            </div>
          </div>
        </div>
        <div class="row">
          <div class="col-md-12">
          	<div style="border: 1px solid #ddd;text-align:left;max-height: 300px; overflow-y: scroll;padding: 15px; background:#fff"> 
            <?php 
        $seller_terms_id = get_post(4850);
        $content = $seller_terms_id->post_content;
        $content = apply_filters('the_content', $content);
        echo $content;
        ?>
            </div>
          </div>
          <?php 
        if ($agreement1 == 'yes') {
            ?>
		  <div class="form-group" style="">
			<div class="col-md-1">
              <div class="checkboxFive">                  
                  <input type="hidden" name="agreement1" value="no" >
                  <input type="checkbox" name="agreement1" value="yes"<?php 
            checked($agreement1, 'yes');
            ?>
 <?php 
            echo $disabled;
            ?>
 required>
                  <label for="checkboxFiveInput"></label>
              </div>			  
            </div>
			<div class="col-md-7" style="text-align:left">
			  <p>Agreement Signed by <b style="font-weight:bold"><?php 
            echo $full_name;
            ?>
</b> on <b style="font-weight:bold"><?php 
            echo $toa;
            ?>
</b></p>
			</div>
			<div class="col-md-4" >
			  <p style="color:red; text-align:right" >Contact Us for any Important Changes & Updates</p>
			</div>
		  </div>
		  <input id="full_name" required value="<?php 
            echo $full_name;
            ?>
" name="full_name" class="form-control input-md" type="hidden" <?php 
            echo $disabled;
            ?>
>
		  <input id="agreement1" required value="<?php 
            echo $agreement1;
            ?>
" name="agreement1"  class="form-control input-md" type="hidden" <?php 
            echo $disabled;
            ?>
>
		  <input id="toa" value="<?php 
            echo $toa;
            ?>
" name="toa" type="hidden">
		  <?php 
        } else {
            ?>
		  <div class="form-group">
			<div class="col-md-1">
              <div class="checkboxFive">                  
                  <input type="hidden" name="agreement1" value="no" >
                  <input id="checkboxFiveInput" type="checkbox" name="agreement1" value="yes"<?php 
            checked($agreement1, 'yes');
            ?>
 <?php 
            echo $disabled;
            ?>
 required>
                  <label for="checkboxFiveInput"></label>
              </div>			  
			</div>			
			<label class="col-md-7 control-label" for="setting_phone" style="text-align:left">
			  <?php 
            _e('I hereby accept the above mentioned terms & conditions', 'dokan');
            ?>
			</label>			
            <div class="col-md-4">
			  <input id="full_name" required value="<?php 
            echo $full_name;
            ?>
" name="full_name" placeholder="Full Name" class="form-control input-md" type="text" <?php 
            echo $disabled;
            ?>
>
			  <input id="toa" value="<?php 
            echo date('d F Y');
            ?>
" name="toa" type="hidden">
			</div>
		  </div>
		  <?php 
        }
        ?>
        </div>
      </section>
      
      <h3>Seller Obligations (MOU)</h3>
      <section>
        <div style="border: 1px solid #ddd;text-align:left;max-height: 500px; overflow-y: scroll;padding: 15px; background:#fff"> 
        <?php 
        $seller_mou = get_post(4859);
        $content_mou = $seller_mou->post_content;
        $content_mou = apply_filters('the_content', $content_mou);
        echo $content_mou;
        ?>
        </div>
        <div class="form-group">
          <div class="col-md-1">
            <div class="checkboxFive">                  
                <input type="hidden" name="mou" value="no" >
                <input id="checkboxFiveInput2" type="checkbox" name="mou" value="yes"<?php 
        checked($mou, 'yes');
        ?>
 <?php 
        echo $disabled;
        ?>
 required>
                <label for="checkboxFiveInput2"></label>
            </div>            
          </div>
          <label class="col-md-11 control-label" for="setting_phone" style="text-align:left">
            <?php 
        _e(' By clicking this checkbox, I agree with Shopwow.in Policy & Rules, User Agreement, Privacy Policy, and MOU agreement above.', 'dokan');
        ?>
          </label>            
        </div>        
      </section>
      
      <h3>Service Fee Plan</h3>
      <section>
		<?php 
        // if(!empty($plans)) {
        ?>
        Plan Type : <?php 
        echo $plans;
        ?>
        <input id="plans" value="<?php 
        echo $plans;
        ?>
" name="plans" type="hidden" <?php 
        echo $disabled;
        ?>
>
        <?php 
        //} else {
        ?>
        <img src="<?php 
        the_field('seller_table', 4859);
        ?>
" style="width: 95%;position: absolute;left: 0;z-index: 9;background: rgba(0,0,0,0.6);margin: 0 2.5%;">
        <div class="row" style="margin-top:85px; margin-bottom: 15px;">
          <?php 
        $query = new WP_Query(array('post_type' => 'service_fee_plans'));
        ?>
			 <?php 
        if ($query->have_posts()) {
            ?>
			   <?php 
            while ($query->have_posts()) {
                $query->the_post();
                ?>
                <div class="col-md-4" >
                  <div class="type">
                    <p><?php 
                the_title();
                ?>
</p>
                  </div>
                  <div class="plan">
                    <input id="<?php 
                the_ID();
                ?>
" name="plans" type="radio"  value="<?php 
                the_title();
                ?>
">
                    <label for="<?php 
                the_ID();
                ?>
">
                    <div class="header"> <span>Rs.</span><?php 
                echo get_post_meta(get_the_ID(), 'fee_price', true);
                ?>
                      <p class="month"><?php 
                echo get_post_meta(get_the_ID(), 'fee_period', true);
                ?>
</p>
                    </div>
                    <div class="content">
                      <ul>
                        <li><i class="fa fa-arrow-right"></i><?php 
                echo get_post_meta(get_the_ID(), 'plan_feature_1', true);
                ?>
</li>
                        <li><i class="fa fa-arrow-right"></i><?php 
                echo get_post_meta(get_the_ID(), 'plan_feature_2', true);
                ?>
</li>
                        <li><i class="fa fa-arrow-right"></i><?php 
                echo get_post_meta(get_the_ID(), 'plan_feature_3', true);
                ?>
</li>
                        <li><i class="fa fa-arrow-right"></i><?php 
                echo get_post_meta(get_the_ID(), 'plan_feature_4', true);
                ?>
</li>
                        <li><i class="fa fa-arrow-right"></i><?php 
                echo get_post_meta(get_the_ID(), 'plan_feature_5', true);
                ?>
</li>
                        <li><i class="fa fa-arrow-right"></i><?php 
                echo get_post_meta(get_the_ID(), 'plan_feature_6', true);
                ?>
</li>
                      </ul>
                    </div>
                    <div class="price">
                      <p class="cart">Select</p>
                    </div>
                    </label>
                  </div>
                </div>
               <?php 
            }
            ?>
			   <?php 
            wp_reset_postdata();
            ?>
		     <?php 
        }
        ?>
        </div>
        <div class="row">
        <?php 
        $seller_mou = get_post(4910);
        $content_mou = $seller_mou->post_content;
        $content_mou = apply_filters('the_content', $content_mou);
        echo $content_mou;
        ?>
        </div>
        <?php 
        //}
        ?>
        <div class="form-group">
          <div class="col-md-1">
            <div class="checkboxFive">                  
                <input type="hidden" name="sfp" value="no" >
                <input id="checkboxFiveInput3" type="checkbox" name="sfp" value="yes"<?php 
        checked($sfp, 'yes');
        ?>
 <?php 
        echo $disabled;
        ?>
 required>
                <label for="checkboxFiveInput3"></label>
            </div>            
          </div>
          <label class="col-md-11 control-label" for="setting_phone" style="text-align:left">
            <?php 
        _e(' By clicking this checkbox, I agree to PAY Service Fee and Shipping Charges as mentioned above.', 'dokan');
        ?>
          </label>            
        </div>
      </section>
      
      <h3>Bank Details</h3>
      <section>
          <!-- payment tab -->
          <div class="form-group">      
            <div class="col-md-12">
              <?php 
        $methods = dokan_withdraw_get_active_methods();
        ?>
        
              <div class="col-md-12">
                <?php 
        $count = 0;
        foreach ($methods as $method_key) {
            $method = dokan_withdraw_get_method($method_key);
            ?>
                <div class="tab-pane<?php 
            echo $count == 0 ? ' active' : '';
            ?>
" id="dokan-payment-<?php 
            echo $method_key;
            ?>
">
                  <?php 
            if (is_callable($method['callback'])) {
                call_user_func($method['callback'], $profile_info);
            }
            ?>
                </div>
                <?php 
            $count++;
        }
        ?>
              <?php 
        $binfo = get_user_meta(get_current_user_id(), 'dokan_profile_settings', true);
        if ($binfo['payment']['bank']['ac_number'] != '') {
            ?>
						<script language="javascript">
						jQuery("#dokan-payment-bank input").prop("readonly",true);
						jQuery('#dokan-payment-bank input').attr('readonly', true);
						jQuery("#dokan-payment-bank textarea").prop("readonly",true); 
						jQuery('#dokan-payment-bank textarea').attr('readonly', true);
						jQuery('#dokan-payment-bank input').css('background-color' , '#eeeeee');
						jQuery('#dokan-payment-bank input').css('cursor' , 'not-allowed');
						jQuery('#dokan-payment-bank textarea').css('background-color' , '#eeeeee');
						jQuery('#dokan-payment-bank textarea').css('cursor' , 'not-allowed');
						</script>
						<?php 
        }
        ?>
 
              </div>
              <!-- .tab-content -->
            </div>            
          </div>
          <!-- .form-group -->
      </section>
      
      <h3>Store Setting</h3>
      <section>
          <div class="dokan-banner">
            <div class="image-wrap<?php 
        echo $banner ? '' : ' dokan-hide';
        ?>
">
              <?php 
        $banner_url = $banner ? wp_get_attachment_url($banner) : '';
        ?>
              <input type="hidden" class="dokan-file-field" value="<?php 
        echo $banner;
        ?>
" name="dokan_banner">
              <img class="dokan-banner-img" src="<?php 
        echo esc_url($banner_url);
        ?>
"> <a class="close dokan-remove-banner-image">&times;</a> </div>
            <div class="button-area<?php 
        echo $banner ? ' dokan-hide' : '';
        ?>
"> <i class="fa fa-cloud-upload"></i> <a href="#" class="dokan-banner-drag btn btn-info">
              <?php 
        _e('Upload banner', 'dokan');
        ?>
              </a>
              <p class="help-block">
                <?php 
        _e('(Upload a banner for your store. Banner size is (825x300) pixel. )', 'dokan');
        ?>
              </p>
            </div>
          </div>
          <div class="row">
            <div class="col-md-6">                   
              <div class="form-group">                
                <div class="col-md-9">
                  <?php 
        _e('Map', 'dokan');
        ?>
                  <input id="dokan-map-lat" type="hidden" name="location" value="<?php 
        echo $map_location;
        ?>
" />
                  <div class="input-group"> <span class="input-group-btn">
                    <input id="dokan-map-add" type="text" class="form-control" value="<?php 
        echo $map_address;
        ?>
" name="find_address" placeholder="<?php 
        _e('Type an address to find', 'dokan');
        ?>
" />
                    <a href="#" class="btn btn-default" id="dokan-location-find-btn" type="button">
                    <?php 
        _e('Find Address', 'dokan');
        ?>
                    </a> </span> </div>
                  <!-- /input-group -->
                  <div class="dokan-google-map" id="dokan-map"></div>
                </div>
                <!-- col.md-4 -->
              </div>
            </div>
            <div class="col-md-6">
              <!-- .dokan-banner -->
              <div class="form-group">
                <label class="col-md-3 control-label" for="dokan_store_name">
                  <?php 
        _e('Store Name', 'dokan');
        ?>
                </label>
                <div class="col-md-9">
                  <input id="dokan_store_name" required value="<?php 
        echo $storename;
        ?>
" name="dokan_store_name" placeholder="store name" class="form-control input-md" type="text">
                </div>
              </div>
              <div class="form-group">
                <label class="col-md-3 control-label" for="dokan_gravatar">
                  <?php 
        _e('Shop Logo', 'dokan');
        ?>
                </label>
                <div class="col-md-9 dokan-gravatar">
                  <div class="pull-left gravatar-wrap<?php 
        echo $gravatar ? '' : ' dokan-hide';
        ?>
">
                    <?php 
        $gravatar_url = $gravatar ? wp_get_attachment_url($gravatar) : '';
        ?>
                    <input type="hidden" class="dokan-file-field" value="<?php 
        echo $gravatar;
        ?>
" name="dokan_gravatar">
                    <img class="dokan-gravatar-img" src="<?php 
        echo esc_url($gravatar_url);
        ?>
"> <a class="close dokan-remove-gravatar-image">&times;</a> </div>
                  <div class="gravatar-button-area<?php 
        echo $gravatar ? ' dokan-hide' : '';
        ?>
"> <i class="fa fa-cloud-upload"></i> <a href="#" class="dokan-gravatar-drag btn btn-info">
                    <?php 
        _e('Upload Photo', 'dokan');
        ?>
                    </a> </div>
                </div>
              </div>
              
              
              <div class="form-group">
                <label class="col-md-3 control-label" for="settings[social][fb]">
                  <?php 
        _e('Social Profile', 'dokan');
        ?>
                </label>
                <div class="col-md-9">
                  <div class="input-group"> <span class="input-group-addon"><i class="fa fa-facebook-square"></i></span>
                    <input id="settings[social][fb]" value="<?php 
        echo $fb;
        ?>
" name="settings[social][fb]" class="form-control" placeholder="http://" type="text">
                  </div>
                </div>
              </div>
              <div class="form-group">
                <label class="col-md-3 control-label" for="settings[social][plus]"></label>
                <div class="col-md-9">
                  <div class="input-group"> <span class="input-group-addon"><i class="fa fa-google-plus"></i></span>
                    <input id="settings[social][gplus]" value="<?php 
        echo $gplus;
        ?>
" name="settings[social][gplus]" class="form-control" placeholder="http://" type="text">
                  </div>
                </div>
              </div>          
              <div class="form-group">
                <label class="col-md-3 control-label" for="settings[social][youtube]"></label>
                <div class="col-md-9">
                  <div class="input-group"> <span class="input-group-addon"><i class="fa fa-youtube"></i></span>
                    <input id="settings[social][youtube]" value="<?php 
        echo $youtube;
        ?>
" name="settings[social][youtube]" class="form-control" placeholder="http://" type="text">
                  </div>
                </div>
              </div>          
            </div>
 			
          </div>
      </section> 
    </div>
    <?php 
        /*wp_nonce_field( 'dokan_settings_nonce' ); ?>
          <div class="dokan-banner">
              <div class="image-wrap<?php echo $banner ? '' : ' dokan-hide'; ?>">
                  <?php $banner_url = $banner ? wp_get_attachment_url( $banner ) : ''; ?>
                  <input type="hidden" class="dokan-file-field" value="<?php echo $banner; ?>" name="dokan_banner">
                  <img class="dokan-banner-img" src="<?php echo esc_url( $banner_url ); ?>">
                  <a class="close dokan-remove-banner-image">&times;</a>
              </div>
              <div class="button-area<?php echo $banner ? ' dokan-hide' : ''; ?>">
                  <i class="fa fa-cloud-upload"></i>
                  <a href="#" class="dokan-banner-drag dokan-btn dokan-btn-info"><?php _e( 'Upload banner', 'dokan' ); ?></a>
                  <p class="help-block"><?php _e( '(Upload a banner for your store. Banner size is (825x300) pixel. )', 'dokan' ); ?></p>
              </div>
          </div> <!-- .dokan-banner -->
          <div class="dokan-form-group">
              <label class="dokan-w3 dokan-control-label" for="dokan_store_name"><?php _e( 'Store Name', 'dokan' ); ?></label>
              <div class="dokan-w5 dokan-text-left">
                  <input id="dokan_store_name" required value="<?php echo $storename; ?>" name="dokan_store_name" placeholder="store name" class="dokan-form-control" type="text">
              </div>
          </div>
          <div class="dokan-form-group">
              <label class="dokan-w3 dokan-control-label" for="dokan_gravatar"><?php _e( 'Profile Picture', 'dokan' ); ?></label>
              <div class="dokan-w5 dokan-gravatar">
                  <div class="dokan-left gravatar-wrap<?php echo $gravatar ? '' : ' dokan-hide'; ?>">
                      <?php $gravatar_url = $gravatar ? wp_get_attachment_url( $gravatar ) : ''; ?>
                      <input type="hidden" class="dokan-file-field" value="<?php echo $gravatar; ?>" name="dokan_gravatar">
                      <img class="dokan-gravatar-img" src="<?php echo esc_url( $gravatar_url ); ?>">
                      <a class="dokan-close dokan-remove-gravatar-image">&times;</a>
                  </div>
                  <div class="gravatar-button-area<?php echo $gravatar ? ' dokan-hide' : ''; ?>">
                      <a href="#" class="dokan-gravatar-drag dokan-btn dokan-btn-default"><i class="fa fa-cloud-upload"></i> <?php _e( 'Upload Photo', 'dokan' ); ?></a>
                  </div>
              </div>
          </div>
          <div class="dokan-form-group">
              <label class="dokan-w3 dokan-control-label" for="settings[social][fb]"><?php _e( 'Social Profile', 'dokan' ); ?></label>
              <div class="dokan-w5 dokan-text-left">
                  <div class="dokan-input-group dokan-form-group">
                      <span class="dokan-input-group-addon"><i class="fa fa-facebook-square"></i></span>
                      <input id="settings[social][fb]" value="<?php echo $fb; ?>" name="settings[social][fb]" class="dokan-form-control" placeholder="http://" type="text">
                  </div>
                  <div class="dokan-input-group dokan-form-group">
                      <span class="dokan-input-group-addon"><i class="fa fa-google-plus"></i></span>
                      <input id="settings[social][gplus]" value="<?php echo $gplus; ?>" name="settings[social][gplus]" class="dokan-form-control" placeholder="http://" type="text">
                  </div>
                  <div class="dokan-input-group dokan-form-group">
                      <span class="dokan-input-group-addon"><i class="fa fa-twitter"></i></span>
                      <input id="settings[social][twitter]" value="<?php echo $twitter; ?>" name="settings[social][twitter]" class="dokan-form-control" placeholder="http://" type="text">
                  </div>
                  <div class="dokan-input-group dokan-form-group">
                      <span class="dokan-input-group-addon"><i class="fa fa-linkedin"></i></span>
                      <input id="settings[social][linkedin]" value="<?php echo $linkedin; ?>" name="settings[social][linkedin]" class="dokan-form-control" placeholder="http://" type="text">
                  </div>
                  <div class="dokan-input-group dokan-form-group">
                      <span class="dokan-input-group-addon"><i class="fa fa-youtube"></i></span>
                      <input id="settings[social][youtube]" value="<?php echo $youtube; ?>" name="settings[social][youtube]" class="dokan-form-control" placeholder="http://" type="text">
                  </div>
              </div>
          </div>
          <!-- payment tab -->
          <div class="dokan-form-group">
              <label class="dokan-w3 dokan-control-label" for="dokan_setting"><?php _e( 'Payment Method', 'dokan' ); ?></label>
              <div class="dokan-w6">
                  <?php $methods = dokan_withdraw_get_active_methods(); ?>
                  <div id="payment_method_tab">
                      <ul class="dokan_tabs" style="margin-bottom: 10px; margin-left:0px;">
                          <?php
                          $count = 0;
                          foreach ($methods as $method_key) {
                              $method = dokan_withdraw_get_method( $method_key );
                              ?>
                              <li<?php echo ( $count == 0 ) ? ' class="active"' : ''; ?>><a href="#dokan-payment-<?php echo $method_key; ?>" data-toggle="tab"><?php echo $method['title']; ?></a></li>
                              <?php
                              $count++;
                          } ?>
                      </ul>
                      <!-- Tab panes -->
                      <div class="tabs_container">
                          <?php
                          $count = 0;
                          foreach ($methods as $method_key) {
                              $method = dokan_withdraw_get_method( $method_key );
                              ?>
                              <div class="tab-pane<?php echo ($count == 0) ? ' active': ''; ?>" id="dokan-payment-<?php echo $method_key; ?>">
                                  <?php if ( is_callable( $method['callback']) ) {
                                      call_user_func( $method['callback'], $profile_info );
                                  } ?>
                              </div>
                              <?php
                              $count++;
                          } ?>
                      </div> <!-- .tabs_container -->
                  </div> <!-- .payment method tab -->
              </div> <!-- .dokan-w4 -->
          </div> <!-- .dokan-form-group -->
          <div class="dokan-form-group">
              <label class="dokan-w3 dokan-control-label" for="setting_phone"><?php _e( 'Phone No', 'dokan' ); ?></label>
              <div class="dokan-w5 dokan-text-left">
                  <input id="setting_phone" value="<?php echo $phone; ?>" name="setting_phone" placeholder="+123456.." class="dokan-form-control input-md" type="text">
              </div>
          </div>
          <div class="dokan-form-group">
              <label class="dokan-w3 dokan-control-label" for="setting_phone"><?php _e( 'Email', 'dokan' ); ?></label>
              <div class="dokan-w5 dokan-text-left">
                  <div class="checkbox">
                      <label>
                          <input type="hidden" name="setting_show_email" value="no">
                          <input type="checkbox" name="setting_show_email" value="yes"<?php checked( $show_email, 'yes' ); ?>> <?php _e( 'Show email address in store', 'dokan' ); ?>
                      </label>
                  </div>
              </div>
          </div>
          <div class="dokan-form-group">
              <label class="dokan-w3 dokan-control-label" for="setting_address"><?php _e( 'Address', 'dokan' ); ?></label>
              <div class="dokan-w5 dokan-text-left">
                  <textarea class="dokan-form-control" rows="4" id="setting_address" name="setting_address"><?php echo $address; ?></textarea>
              </div>
          </div>
          <div class="dokan-form-group">
              <label class="dokan-w3 dokan-control-label" for="setting_map"><?php _e('Map', 'dokan'); ?></label>
              <div class="dokan-w4 dokan-text-left">
                  <input id="dokan-map-lat" type="hidden" name="location" value="<?php echo $map_location; ?>" size="30" />
                  <div class="dokan-input-group">
                      <span class="">
                          <input id="dokan-map-add" type="text" class="dokan-form-control" value="<?php echo $map_address; ?>" name="find_address" placeholder="<?php _e( 'Type an address to find', 'dokan' ); ?>" size="30" />
                          <a href="#" class="" id="dokan-location-find-btn" type="button"><?php _e( 'Find Address', 'dokan' ); ?></a>
                      </span>
                  </div><!-- /input-group -->
                  <div class="dokan-google-map" id="dokan-map" style="width:400px; height:300px;"></div>
              </div> <!-- col.md-4 -->
          </div> <!-- .dokan-form-group -->
          <div class="dokan-form-group">
              <div class="dokan-w4 ajax_prev dokan-text-left" style="margin-left:24%;">
                  <input type="submit" name="dokan_update_profile" class="btn btn-primary" value="<?php esc_attr_e('Update Settings','dokan'); ?>">
              </div>
          </div> */
        ?>
</form>
                <script type="text/javascript">
                    (function($) {
                        $(function() {
                            <?php 
        $locations = explode(',', $map_location);
        $def_lat = isset($locations[0]) ? $locations[0] : 90.40714300000002;
        $def_long = isset($locations[1]) ? $locations[1] : 23.709921;
        ?>
                            var def_zoomval = 12;
                            var def_longval = '<?php 
        echo $def_long;
        ?>
';
                            var def_latval = '<?php 
        echo $def_lat;
        ?>
';
                            var curpoint = new google.maps.LatLng(def_latval, def_longval),
                                geocoder   = new window.google.maps.Geocoder(),
                                $map_area = $('#dokan-map'),
                                $input_area = $( '#dokan-map-lat' ),
                                $input_add = $( '#dokan-map-add' ),
                                $find_btn = $( '#dokan-location-find-btn' );
                            autoCompleteAddress();
                            $find_btn.on('click', function(e) {
                                e.preventDefault();
                                geocodeAddress( $input_add.val() );
                            });
                            var gmap = new google.maps.Map( $map_area[0], {
                                center: curpoint,
                                zoom: def_zoomval,
                                mapTypeId: window.google.maps.MapTypeId.ROADMAP
                            });
                            var marker = new window.google.maps.Marker({
                                position: curpoint,
                                map: gmap,
                                draggable: true
                            });
                            window.google.maps.event.addListener( gmap, 'click', function ( event ) {
                                marker.setPosition( event.latLng );
                                updatePositionInput( event.latLng );
                            } );
                            window.google.maps.event.addListener( marker, 'drag', function ( event ) {
                                updatePositionInput(event.latLng );
                            } );
                            function updatePositionInput( latLng ) {
                                $input_area.val( latLng.lat() + ',' + latLng.lng() );
                            }
                            function updatePositionMarker() {
                                var coord = $input_area.val(),
                                    pos, zoom;
                                if ( coord ) {
                                    pos = coord.split( ',' );
                                    marker.setPosition( new window.google.maps.LatLng( pos[0], pos[1] ) );
                                    zoom = pos.length > 2 ? parseInt( pos[2], 10 ) : 12;
                                    gmap.setCenter( marker.position );
                                    gmap.setZoom( zoom );
                                }
                            }
                            function geocodeAddress( address ) {
                                geocoder.geocode( {'address': address}, function ( results, status ) {
                                    if ( status == window.google.maps.GeocoderStatus.OK ) {
                                        updatePositionInput( results[0].geometry.location );
                                        marker.setPosition( results[0].geometry.location );
                                        gmap.setCenter( marker.position );
                                        gmap.setZoom( 15 );
                                    }
                                } );
                            }
                            function autoCompleteAddress(){
                                if (!$input_add) return null;
                                $input_add.autocomplete({
                                    source: function(request, response) {
                                        // TODO: add 'region' option, to help bias geocoder.
                                        geocoder.geocode( {'address': request.term }, function(results, status) {
                                            response(jQuery.map(results, function(item) {
                                                return {
                                                    label     : item.formatted_address,
                                                    value     : item.formatted_address,
                                                    latitude  : item.geometry.location.lat(),
                                                    longitude : item.geometry.location.lng()
                                                };
                                            }));
                                        });
                                    },
                                    select: function(event, ui) {
                                        $input_area.val(ui.item.latitude + ',' + ui.item.longitude );
                                        var location = new window.google.maps.LatLng(ui.item.latitude, ui.item.longitude);
                                        gmap.setCenter(location);
                                        // Drop the Marker
                                        setTimeout( function(){
                                            marker.setValues({
                                                position    : location,
                                                animation   : window.google.maps.Animation.DROP
                                            });
                                        }, 1500);
                                    }
                                });
                            }
                        });
                    })(jQuery);
                </script>
                <script>
				    (function($){
                        $(document).ready(function(){
                            $('#payment_method_tab').easytabs();
                        });
                    })(jQuery)
                </script>
                <script type="text/javascript">
					jQuery(function($){
                        // $('#setting_category').chosen({
                        //     width: "95%"
                        // }).change(function() {
                        //     $("form#settings-form").validate().element("#setting_category");
                        // });
                    })
                </script>
        <?php 
    }
 /**
  * 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));
 }
 /**
  * Save user data
  *
  * @param int $user_id
  *
  * @return void
  */
 function save_meta_fields($user_id)
 {
     if (!current_user_can('manage_woocommerce')) {
         return;
     }
     if (!isset($_POST['dokan_enable_selling'])) {
         return;
     }
     $selling = sanitize_text_field($_POST['dokan_enable_selling']);
     $publishing = sanitize_text_field($_POST['dokan_publish']);
     $percentage = floatval($_POST['dokan_seller_percentage']);
     $feature_seller = sanitize_text_field($_POST['dokan_feature']);
     $store_settings = dokan_get_store_info($user_id);
     $social = $_POST['dokan_social'];
     $social_fields = dokan_get_social_profile_fields();
     $store_settings['banner'] = intval($_POST['dokan_banner']);
     $store_settings['store_name'] = sanitize_text_field($_POST['dokan_store_name']);
     $store_settings['address'] = isset($_POST['dokan_store_address']) ? $_POST['dokan_store_address'] : array();
     $store_settings['phone'] = sanitize_text_field($_POST['dokan_store_phone']);
     // social settings
     if (is_array($social)) {
         foreach ($social as $key => $value) {
             if (isset($social_fields[$key])) {
                 $store_settings['social'][$key] = filter_var($social[$key], FILTER_VALIDATE_URL);
             }
         }
     }
     update_user_meta($user_id, 'dokan_profile_settings', $store_settings);
     update_user_meta($user_id, 'dokan_enable_selling', $selling);
     update_user_meta($user_id, 'dokan_publishing', $publishing);
     update_user_meta($user_id, 'dokan_seller_percentage', $percentage);
     update_user_meta($user_id, 'dokan_feature_seller', $feature_seller);
     do_action('dokan_process_seller_meta_fields', $user_id);
 }
Beispiel #27
0
 /**
  * Save user data
  *
  * @param int $user_id
  * @return void
  */
 function save_meta_fields($user_id)
 {
     if (!current_user_can('manage_woocommerce')) {
         return;
     }
     if (!isset($_POST['dokan_enable_selling'])) {
         return;
     }
     $selling = sanitize_text_field($_POST['dokan_enable_selling']);
     $publishing = sanitize_text_field($_POST['dokan_publish']);
     $percentage = floatval($_POST['dokan_seller_percentage']);
     $store_settings = dokan_get_store_info($user_id);
     $social = $_POST['dokan_social'];
     $store_settings['store_status'] = sanitize_text_field($_POST['dokan_store_status']);
     $store_settings['banner'] = intval($_POST['dokan_banner']);
     $store_settings['store_name'] = sanitize_text_field($_POST['dokan_store_name']);
     $store_settings['address'] = wp_kses_post($_POST['dokan_store_address']);
     $store_settings['phone'] = sanitize_text_field($_POST['dokan_store_phone']);
     $store_settings['social'] = array('fb' => filter_var($social['fb'], FILTER_VALIDATE_URL), 'gplus' => filter_var($social['gplus'], FILTER_VALIDATE_URL), 'twitter' => filter_var($social['twitter'], FILTER_VALIDATE_URL), 'linkedin' => filter_var($social['linkedin'], FILTER_VALIDATE_URL), 'youtube' => filter_var($social['youtube'], FILTER_VALIDATE_URL));
     //Custom
     $store_settings['payment']['bank']['ac_name'] = sanitize_text_field($_POST['dokan_account_name']);
     $store_settings['payment']['bank']['ac_number'] = sanitize_text_field($_POST['dokan_account_number']);
     $store_settings['payment']['bank']['bank_name'] = sanitize_text_field($_POST['dokan_bank_name']);
     $store_settings['payment']['bank']['bank_addr'] = sanitize_text_field($_POST['dokan_bank_address']);
     $store_settings['payment']['bank']['swift'] = sanitize_text_field($_POST['dokan_bank_ifsc']);
     $store_settings['legal_stat'] = sanitize_text_field($_POST['dokan_legal_status']);
     $store_settings['pan_no'] = sanitize_text_field($_POST['dokan_pan']);
     $store_settings['vat_no'] = sanitize_text_field($_POST['dokan_vat']);
     $store_settings['bus_cat'] = sanitize_text_field($_POST['dokan_bus_cat']);
     update_user_meta($user_id, 'dokan_profile_settings', $store_settings);
     update_user_meta($user_id, 'dokan_enable_selling', $selling);
     update_user_meta($user_id, 'dokan_publishing', $publishing);
     update_user_meta($user_id, 'dokan_seller_percentage', $percentage);
 }
Beispiel #28
0
 /**
  * Submit handler for settings form
  *
  * @return void
  */
 function dokan_seo_form_handler()
 {
     parse_str($_POST['data'], $postdata);
     if (!wp_verify_nonce($postdata['dokan_store_seo_form_nonce'], 'dokan_store_seo_form_action')) {
         wp_send_json_error(__('Are you cheating?', 'dokan'));
     }
     unset($postdata['dokan_store_seo_form_nonce']);
     unset($postdata['_wp_http_referer']);
     $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);
     $current_user = get_current_user_id();
     $seller_profile = dokan_get_store_info($current_user);
     $seller_profile['store_seo'] = wp_parse_args($postdata, $default_store_seo);
     //unset( $seller_profile['store_seo'] );
     update_user_meta($current_user, 'dokan_profile_settings', $seller_profile);
     wp_send_json_success(__('Your changes has been updated!', 'dokan'));
 }
Beispiel #29
0
                        <td class="order-status" style="text-align:left; white-space:nowrap;">
                            <?php 
        echo isset($statuses[$order->post_status]) ? $statuses[$order->post_status] : $order->post_status;
        ?>
                        </td>
                        <td class="order-total">
                            <?php 
        echo sprintf(_n('%s for %s item', '%s for %s items', $item_count, 'dokan'), $order->get_formatted_order_total(), $item_count);
        ?>
                        </td>
                        
                        <td class="order-total">
                            <?php 
        $seller_id = dokan_get_seller_id_by_order($order->id);
        if ($seller_id && $seller_id != 0) {
            $sellershop = dokan_get_store_info($seller_id);
            echo '<a href="' . dokan_get_store_url($seller_id) . '">' . $sellershop['store_name'] . '</a>';
        } else {
            _e('Multiple Seller', 'dokan');
        }
        ?>
                        </td>

                        <td class="order-actions">
                            <?php 
        $actions = array();
        if (in_array($order->status, apply_filters('woocommerce_valid_order_statuses_for_payment', array('pending', 'failed'), $order))) {
            $actions['pay'] = array('url' => $order->get_checkout_payment_url(), 'name' => __('Pay', 'dokan'));
        }
        if (in_array($order->status, apply_filters('woocommerce_valid_order_statuses_for_cancel', array('pending', 'failed'), $order))) {
            $actions['cancel'] = array('url' => $order->get_cancel_order_url(get_permalink(wc_get_page_id('myaccount'))), 'name' => __('Cancel', 'dokan'));
Beispiel #30
0
?>
            <!--settings updated content-->
            <?php 
global $current_user;
if (isset($_GET['message'])) {
    ?>
                <div class="dokan-alert dokan-alert-success">
                    <button type="button" class="dokan-close" data-dismiss="alert">&times;</button>
                    <strong><?php 
    _e('Your profile has been updated successfully!', 'dokan');
    ?>
</strong>
                </div>
            <?php 
}
$profile_info = dokan_get_store_info($current_user->ID);
if (is_wp_error($validate)) {
}
?>

            <div class="dokan-ajax-response">
                <?php 
echo dokan_get_profile_progressbar();
?>
            </div>

            <?php 
/**
 * @since 2.2.2 Insert action before payment settings form
 */
do_action('dokan_payment_settings_before_form', $current_user, $profile_info);