Dokan – Best WooCommerce Multivendor Marketplace Solution – Build Your Own Amazon, eBay, Etsy - Version 3.5.0

Version Description

Download this release

Release Info

Developer tareq1988
Plugin Icon wp plugin Dokan – Best WooCommerce Multivendor Marketplace Solution – Build Your Own Amazon, eBay, Etsy
Version 3.5.0
Comparing to
See all releases

Code changes from version 3.4.3 to 3.5.0

dokan.php CHANGED
@@ -3,12 +3,12 @@
3
  * Plugin Name: Dokan
4
  * Plugin URI: https://wordpress.org/plugins/dokan-lite/
5
  * Description: An e-commerce marketplace plugin for WordPress. Powered by WooCommerce and weDevs.
6
- * Version: 3.4.3
7
  * Author: weDevs
8
  * Author URI: https://wedevs.com/
9
  * Text Domain: dokan-lite
10
- * WC requires at least: 3.0
11
- * WC tested up to: 6.4.1
12
  * Domain Path: /languages/
13
  * License: GPL2
14
  */
@@ -56,7 +56,7 @@ final class WeDevs_Dokan {
56
  *
57
  * @var string
58
  */
59
- public $version = '3.4.3';
60
 
61
  /**
62
  * Instance of self
@@ -70,7 +70,7 @@ final class WeDevs_Dokan {
70
  *
71
  * @var string
72
  */
73
- private $min_php = '5.6.0';
74
 
75
  /**
76
  * Holds various class instances
3
  * Plugin Name: Dokan
4
  * Plugin URI: https://wordpress.org/plugins/dokan-lite/
5
  * Description: An e-commerce marketplace plugin for WordPress. Powered by WooCommerce and weDevs.
6
+ * Version: 3.5.0
7
  * Author: weDevs
8
  * Author URI: https://wedevs.com/
9
  * Text Domain: dokan-lite
10
+ * WC requires at least: 5.0.0
11
+ * WC tested up to: 6.5.1
12
  * Domain Path: /languages/
13
  * License: GPL2
14
  */
56
  *
57
  * @var string
58
  */
59
+ public $version = '3.5.0';
60
 
61
  /**
62
  * Instance of self
70
  *
71
  * @var string
72
  */
73
+ private $min_php = '7.0';
74
 
75
  /**
76
  * Holds various class instances
includes/Product/ProductCache.php CHANGED
@@ -28,6 +28,8 @@ class ProductCache {
28
 
29
  add_action( 'wp_trash_post', [ $this, 'clear_seller_product_caches' ], 20 );
30
  add_action( 'delete_post', [ $this, 'clear_seller_product_caches' ], 20 );
 
 
31
 
32
  add_action( 'dokan_product_updated', [ $this, 'clear_single_product_caches' ], 20 );
33
  add_action( 'dokan_bulk_product_status_change', [ $this, 'cache_clear_bulk_product_status_change' ], 20, 2 );
@@ -52,6 +54,8 @@ class ProductCache {
52
  return;
53
  }
54
 
 
 
55
  $seller_id = get_post_field( 'post_author', $product->get_id() );
56
  self::delete( $seller_id );
57
  }
@@ -96,6 +100,8 @@ class ProductCache {
96
  wp_cache_delete( $product->get_id(), 'posts' );
97
  wp_cache_delete( $product->get_id(), 'post_meta' );
98
 
 
 
99
  try {
100
  $store = \WC_Data_Store::load( 'product-' . $product->get_type() );
101
  $class = $store->get_current_class_name();
@@ -115,6 +121,30 @@ class ProductCache {
115
  }
116
  }
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  /**
119
  * Clear Cache on bulk product status change.
120
  *
@@ -134,6 +164,8 @@ class ProductCache {
134
  foreach ( $products as $product_id ) {
135
  $this->clear_single_product_caches( $product_id );
136
  $this->clear_seller_product_caches( $product_id );
 
 
137
  }
138
  }
139
  }
28
 
29
  add_action( 'wp_trash_post', [ $this, 'clear_seller_product_caches' ], 20 );
30
  add_action( 'delete_post', [ $this, 'clear_seller_product_caches' ], 20 );
31
+ add_action( 'woocommerce_attribute_updated', [ $this, 'clear_seller_product_caches' ], 20 );
32
+ add_action( 'woocommerce_attribute_deleted', [ $this, 'clear_seller_product_caches' ], 20 );
33
 
34
  add_action( 'dokan_product_updated', [ $this, 'clear_single_product_caches' ], 20 );
35
  add_action( 'dokan_bulk_product_status_change', [ $this, 'cache_clear_bulk_product_status_change' ], 20, 2 );
54
  return;
55
  }
56
 
57
+ // Delete caches for this product taxonomy.
58
+ $this->clear_single_product_taxonomy_caches( $product );
59
  $seller_id = get_post_field( 'post_author', $product->get_id() );
60
  self::delete( $seller_id );
61
  }
100
  wp_cache_delete( $product->get_id(), 'posts' );
101
  wp_cache_delete( $product->get_id(), 'post_meta' );
102
 
103
+ // Delete caches for this product taxonomy.
104
+ $this->clear_single_product_taxonomy_caches( $product );
105
  try {
106
  $store = \WC_Data_Store::load( 'product-' . $product->get_type() );
107
  $class = $store->get_current_class_name();
121
  }
122
  }
123
 
124
+ /**
125
+ * Clear Single Product taxonomy Caches.
126
+ *
127
+ * @since 3.5.0
128
+ *
129
+ * @param int|\WC_Product $product
130
+ *
131
+ * @return void
132
+ */
133
+ public function clear_single_product_taxonomy_caches( $product ) {
134
+ if ( ! $product instanceof \WC_Product ) {
135
+ $product = wc_get_product( $product );
136
+ }
137
+
138
+ if ( ! $product instanceof \WC_Product ) {
139
+ return;
140
+ }
141
+
142
+ $vendor_id = dokan_get_vendor_by_product( $product, true );
143
+ $transient_group = "seller_taxonomy_widget_data_{$vendor_id}";
144
+
145
+ Cache::invalidate_transient_group( $transient_group );
146
+ }
147
+
148
  /**
149
  * Clear Cache on bulk product status change.
150
  *
164
  foreach ( $products as $product_id ) {
165
  $this->clear_single_product_caches( $product_id );
166
  $this->clear_seller_product_caches( $product_id );
167
+ // Delete caches for this product taxonomy.
168
+ $this->clear_single_product_taxonomy_caches( $product_id );
169
  }
170
  }
171
  }
includes/Rewrites.php CHANGED
@@ -303,6 +303,17 @@ class Rewrites {
303
  $tax_query = [];
304
  $query->query['term_section'] = isset( $query->query['term_section'] ) ? $query->query['term_section'] : [];
305
 
 
 
 
 
 
 
 
 
 
 
 
306
  if ( $query->query['term_section'] ) {
307
  array_push(
308
  $tax_query, [
303
  $tax_query = [];
304
  $query->query['term_section'] = isset( $query->query['term_section'] ) ? $query->query['term_section'] : [];
305
 
306
+ $attributes = dokan_get_chosen_taxonomy_attributes();
307
+ if ( ! empty( $attributes ) ) {
308
+ foreach ( $attributes as $key => $attribute ) {
309
+ $tax_query[] = [
310
+ 'taxonomy' => $key,
311
+ 'field' => 'name',
312
+ 'terms' => $attribute['terms'],
313
+ ];
314
+ }
315
+ }
316
+
317
  if ( $query->query['term_section'] ) {
318
  array_push(
319
  $tax_query, [
includes/Vendor/Vendor.php CHANGED
@@ -668,6 +668,71 @@ class Vendor {
668
  return $all_categories;
669
  }
670
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
671
  /**
672
  * Get vendor orders
673
  *
668
  return $all_categories;
669
  }
670
 
671
+ /**
672
+ * Get vendor used terms list.
673
+ *
674
+ * @since 3.5.0
675
+ *
676
+ * @param $vendor_id
677
+ * @param $taxonomy
678
+ *
679
+ * @return array|mixed
680
+ */
681
+ public function get_vendor_used_terms_list( $vendor_id, $taxonomy ){
682
+ $transient_group = "seller_taxonomy_widget_data_{$this->get_id()}";
683
+ $transient_key = function_exists( 'wpml_get_current_language' ) ? 'product_taxonomy_'. $taxonomy .'_' . wpml_get_current_language() : 'product_taxonomy_'. $taxonomy;
684
+
685
+ // get the author's posts
686
+ $products = $this->get_published_products();
687
+ if ( empty( $products ) ) {
688
+ return [];
689
+ }
690
+
691
+ $author_terms = Cache::get_transient( $transient_key, $transient_group );
692
+
693
+ if ( false !== $author_terms ) {
694
+ return $author_terms;
695
+ }
696
+
697
+ $author_terms = [];
698
+ //loop over the posts and collect the terms
699
+ $category_index = [];
700
+ foreach ( $products as $product ) {
701
+ $terms = get_the_terms( $product, $taxonomy );
702
+ if ( ! $terms || is_wp_error( $terms ) ) {
703
+ continue;
704
+ }
705
+
706
+ foreach ( $terms as $term ) {
707
+ $args = [
708
+ 'nopaging' => true,
709
+ 'post_type' => 'product',
710
+ 'author' => $vendor_id,
711
+ 'tax_query' => [
712
+ [
713
+ 'taxonomy' => $taxonomy,
714
+ 'field' => 'slug',
715
+ 'terms' => $term
716
+ ],
717
+ ],
718
+ 'fields' => 'ids'
719
+ ];
720
+
721
+ $all_posts = get_posts( $args );
722
+
723
+ if ( ! in_array( $term->term_id, $category_index, true ) ) {
724
+ $term->count = count( $all_posts );
725
+ $category_index[] = $term->term_id;
726
+ $author_terms[] = $term;
727
+ }
728
+ }
729
+ }
730
+
731
+ // Cache::set_transient( $transient_key, $author_terms, $transient_group );
732
+
733
+ return $author_terms;
734
+ }
735
+
736
  /**
737
  * Get vendor orders
738
  *
includes/Widgets/FilterByAttributes.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeDevs\Dokan\Widgets;
4
+
5
+ use WeDevs\Dokan\Vendor\Vendor;
6
+ use WP_Widget;
7
+
8
+ class FilterByAttributes extends WP_Widget {
9
+
10
+ /**
11
+ * Register widget with WordPress.
12
+ */
13
+ public function __construct() {
14
+ parent::__construct(
15
+ 'dokan-filter-product', __( 'Dokan: Filter Products by Attribute Widget', 'dokan-lite' ),
16
+ [
17
+ 'description' => __( 'A Widget for displaying products by attribute for dokan', 'dokan-lite' ),
18
+ 'classname' => 'dokan-lite widget_products dokan-top-rated',
19
+ ]
20
+ );
21
+ }
22
+
23
+ /**
24
+ * Front-end display of widget.
25
+ *
26
+ * @since DOKAN_PRO_SINCE
27
+ *
28
+ * @param array $args Widget arguments.
29
+ * @param array $instance Saved values from database.
30
+ *
31
+ * @see WP_Widget::widget()
32
+ */
33
+ public function widget( $args, $instance ) {
34
+ if ( ! dokan_is_store_listing() && ! dokan_is_store_page() ) {
35
+ return;
36
+ }
37
+
38
+ $taxonomy = $this->get_instance_taxonomy( $instance );
39
+ $seller_id = empty( $seller_id ) ? get_query_var( 'author' ) : $seller_id;
40
+ $vendor = dokan()->vendor->get( $seller_id );
41
+
42
+ if ( ! $vendor instanceof Vendor ) {
43
+ return;
44
+ }
45
+
46
+ $terms = $vendor->get_vendor_used_terms_list( $seller_id, $taxonomy );
47
+ if ( empty( $terms ) ) {
48
+ return;
49
+ }
50
+
51
+ $title = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'] ) : '';
52
+ $query_type = isset( $instance['query_type'] ) ? apply_filters( 'widget_query_type', $instance['query_type'] ) : '';
53
+
54
+ echo $args['before_widget'];
55
+ if ( ! empty( $title ) ) {
56
+ echo $args['before_title'] . $title . $args['after_title'];
57
+ }
58
+
59
+ $seller_id = empty( $seller_id ) ? get_query_var( 'author' ) : $seller_id;
60
+
61
+ dokan_store_term_menu_list( $seller_id, $taxonomy, $query_type );
62
+
63
+ echo $args['after_widget'];
64
+
65
+ wp_reset_postdata();
66
+ }
67
+
68
+ /**
69
+ * Back-end widget form.
70
+ *
71
+ * @since DOKAN_PRO_SINCE
72
+ *
73
+ * @param array $instance Previously saved values from database.
74
+ *
75
+ * @see WP_Widget::form()
76
+ */
77
+ public function form( $instance ) {
78
+ if ( isset( $instance['title'] ) ) {
79
+ $title = esc_attr( $instance['title'] );
80
+ } else {
81
+ $title = __( 'Filter by', 'dokan-lite' );
82
+ }
83
+
84
+ $attribute_array = [];
85
+ $std_attribute = '';
86
+ $attribute_taxonomies = wc_get_attribute_taxonomies();
87
+
88
+ if ( ! empty( $attribute_taxonomies ) ) {
89
+ foreach ( $attribute_taxonomies as $tax ) {
90
+ if ( taxonomy_exists( wc_attribute_taxonomy_name( $tax->attribute_name ) ) ) {
91
+ $attribute_array[ $tax->attribute_name ] = $tax->attribute_name;
92
+ }
93
+ }
94
+ $std_attribute = current( $attribute_array );
95
+ }
96
+
97
+ $attribute_value = isset( $instance['attribute'] ) ? $instance['attribute'] : $std_attribute;
98
+ $query_type = [
99
+ 'and' => __( 'AND', 'dokan-lite' ),
100
+ 'or' => __( 'OR', 'dokan-lite' ),
101
+ ];
102
+ $query_value = isset( $instance['query_type'] ) ? $instance['query_type'] : '';
103
+
104
+ ?>
105
+ <p>
106
+ <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'dokan-lite' ); ?></label>
107
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
108
+ </p>
109
+ <p>
110
+ <label for="<?php echo esc_attr( $this->get_field_id( 'attribute' ) ); ?>"><?php echo __( 'Attribute', 'dokan-lite' ); ?></label>
111
+ <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'attribute' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'attribute' ) ); ?>">
112
+ <?php foreach ( $attribute_array as $option_key => $option_value ) : ?>
113
+ <option value="<?php echo esc_attr( $option_key ); ?>" <?php selected( $option_key, $attribute_value ); ?>><?php echo esc_html( $option_value ); ?></option>
114
+ <?php endforeach; ?>
115
+ </select>
116
+ </p>
117
+ <p>
118
+ <label for="<?php echo esc_attr( $this->get_field_id( 'query_type' ) ); ?>"><?php echo __( 'Query Type', 'dokan-lite' ); ?></label>
119
+ <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'query_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'query_type' ) ); ?>">
120
+ <?php foreach ( $query_type as $option_key => $option_value ) : ?>
121
+ <option value="<?php echo esc_attr( $option_key ); ?>" <?php selected( $option_key, $query_value ); ?>><?php echo esc_html( $option_value ); ?></option>
122
+ <?php endforeach; ?>
123
+ </select>
124
+ </p>
125
+ <?php
126
+ }
127
+
128
+ /**
129
+ * Sanitize widget form values as they are saved.
130
+ *
131
+ * @since DOKAN_PRO_SINCE
132
+ *
133
+ * @param array $new_instance Values just sent to be saved.
134
+ * @param array $old_instance Previously saved values from database.
135
+ *
136
+ * @see WP_Widget::update()
137
+ *
138
+ * @see WP_Widget::update()
139
+ *
140
+ * @return array Updated safe values to be saved.
141
+ */
142
+ public function update( $new_instance, $old_instance ) {
143
+ $instance = [];
144
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? wp_strip_all_tags( $new_instance['title'] ) : '';
145
+ $instance['attribute'] = ( ! empty( $new_instance['attribute'] ) ) ? wp_strip_all_tags( $new_instance['attribute'] ) : '';
146
+ $instance['query_type'] = ( ! empty( $new_instance['query_type'] ) ) ? wp_strip_all_tags( $new_instance['query_type'] ) : '';
147
+
148
+ return $instance;
149
+ }
150
+
151
+ /**
152
+ * Get this widget taxonomy.
153
+ *
154
+ * @since DOKAN_PRO_SINCE
155
+ *
156
+ * @param array $instance Array of instance options.
157
+ *
158
+ * @return string
159
+ */
160
+ protected function get_instance_taxonomy( $instance ) {
161
+ if ( isset( $instance['attribute'] ) ) {
162
+ return wc_attribute_taxonomy_name( $instance['attribute'] );
163
+ }
164
+
165
+ $attribute_taxonomies = wc_get_attribute_taxonomies();
166
+
167
+ if ( ! empty( $attribute_taxonomies ) ) {
168
+ foreach ( $attribute_taxonomies as $tax ) {
169
+ if ( taxonomy_exists( wc_attribute_taxonomy_name( $tax->attribute_name ) ) ) {
170
+ return wc_attribute_taxonomy_name( $tax->attribute_name );
171
+ }
172
+ }
173
+ }
174
+
175
+ return '';
176
+ }
177
+
178
+ }
includes/Widgets/Manager.php CHANGED
@@ -25,6 +25,7 @@ class Manager {
25
  'store_category_menu' => 'WeDevs\Dokan\Widgets\StoreCategoryMenu',
26
  'toprated_products' => 'WeDevs\Dokan\Widgets\TopratedProducts',
27
  'store_open_close' => 'WeDevs\Dokan\Widgets\StoreOpenClose',
 
28
  ]
29
  );
30
 
25
  'store_category_menu' => 'WeDevs\Dokan\Widgets\StoreCategoryMenu',
26
  'toprated_products' => 'WeDevs\Dokan\Widgets\TopratedProducts',
27
  'store_open_close' => 'WeDevs\Dokan\Widgets\StoreOpenClose',
28
+ 'filter_by_attribute' => 'WeDevs\Dokan\Widgets\FilterByAttributes',
29
  ]
30
  );
31
 
includes/template-tags.php CHANGED
@@ -7,6 +7,8 @@
7
  * @package dokan
8
  */
9
 
 
 
10
  if ( ! function_exists( 'dokan_content_nav' ) ) :
11
 
12
  /**
@@ -595,7 +597,7 @@ if ( ! function_exists( 'dokan_store_category_menu' ) ) :
595
  <?php
596
  $seller_id = empty( $seller_id ) ? get_query_var( 'author' ) : $seller_id;
597
  $vendor = dokan()->vendor->get( $seller_id );
598
- if ( $vendor instanceof \WeDevs\Dokan\Vendor\Vendor ) {
599
  $categories = $vendor->get_store_categories();
600
  $walker = new \WeDevs\Dokan\Walkers\StoreCategory( $seller_id );
601
  echo '<ul>';
@@ -608,6 +610,130 @@ if ( ! function_exists( 'dokan_store_category_menu' ) ) :
608
  }
609
 
610
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
611
 
612
  function dokan_seller_reg_form_fields() {
613
  $postdata = wc_clean( $_POST ); //phpcs:ignore
7
  * @package dokan
8
  */
9
 
10
+ use WeDevs\Dokan\Vendor\Vendor;
11
+
12
  if ( ! function_exists( 'dokan_content_nav' ) ) :
13
 
14
  /**
597
  <?php
598
  $seller_id = empty( $seller_id ) ? get_query_var( 'author' ) : $seller_id;
599
  $vendor = dokan()->vendor->get( $seller_id );
600
+ if ( $vendor instanceof Vendor ) {
601
  $categories = $vendor->get_store_categories();
602
  $walker = new \WeDevs\Dokan\Walkers\StoreCategory( $seller_id );
603
  echo '<ul>';
610
  }
611
 
612
  endif;
613
+ if ( ! function_exists( 'dokan_store_term_menu_list' ) ) :
614
+
615
+ /**
616
+ * Store category menu for a store
617
+ *
618
+ * @since 3.5.0
619
+ *
620
+ * @param int $seller_id
621
+ * @param array $taxonomy
622
+ * @param string $query_type
623
+ *
624
+ * @return void
625
+ */
626
+ function dokan_store_term_menu_list( $seller_id, $taxonomy, $query_type ) {
627
+ ?>
628
+ <div id="cat-drop-stack" class="store-cat-stack-dokan">
629
+ <?php
630
+ $seller_id = empty( $seller_id ) ? get_query_var( 'author' ) : $seller_id;
631
+ $vendor = dokan()->vendor->get( $seller_id );
632
+ $store_url = dokan_get_store_url( $seller_id );
633
+
634
+ if ( $vendor instanceof Vendor ) {
635
+ $terms = $vendor->get_vendor_used_terms_list( $seller_id, $taxonomy );
636
+
637
+ echo '<ul>';
638
+ $_chosen_attributes = dokan_get_chosen_taxonomy_attributes();
639
+ foreach ( $terms as $term ) {
640
+ $current_values = isset( $_chosen_attributes[ $taxonomy ]['terms'] ) ? $_chosen_attributes[ $taxonomy ]['terms'] : [];
641
+ $option_is_set = in_array( $term->slug, $current_values, true );
642
+ $filter_name = 'filter_' . wc_attribute_taxonomy_slug( $taxonomy );
643
+ // phpcs:ignore
644
+ $current_filter = isset( $_GET[ $filter_name ] ) ? explode( ',', wc_clean( wp_unslash( $_GET[ $filter_name ] ) ) ) : array();
645
+
646
+ if ( ! in_array( $term->slug, $current_filter, true ) ) {
647
+ $current_filter[] = $term->slug;
648
+ }
649
+
650
+ $link = remove_query_arg( $filter_name, $store_url );
651
+ // Add current filters to URL.
652
+ foreach ( $current_filter as $key => $value ) {
653
+ // Exclude query arg for current term archive term.
654
+ if ( $value === dokan_get_current_term_slug() ) {
655
+ unset( $current_filter[ $key ] );
656
+ }
657
+
658
+ // Exclude self so filter can be unset on click.
659
+ if ( $option_is_set && $value === $term->slug ) {
660
+ unset( $current_filter[ $key ] );
661
+ }
662
+ }
663
+
664
+ if ( ! empty( $current_filter ) ) {
665
+ asort( $current_filter );
666
+ $link = add_query_arg( $filter_name, implode( ',', $current_filter ), $link );
667
+
668
+ // Add Query type Arg to URL.
669
+ if ( 'or' === $query_type && ! ( 1 === count( $current_filter ) && $option_is_set ) ) {
670
+ $link = add_query_arg( 'query_type_' . wc_attribute_taxonomy_slug( $taxonomy ), 'or', $link );
671
+ }
672
+ $link = str_replace( '%2C', ',', $link );
673
+ }
674
+
675
+ $checked = '';
676
+ if ( $option_is_set ) {
677
+ $checked = 'checked';
678
+ }
679
+
680
+ echo '
681
+ <li class="parent-cat-wrap">
682
+ <a href=' . esc_url( $link ) . '> <input style="pointer-events: none;" type="checkbox" ' . $checked . '> &nbsp;' . $term->name . ' <span style="float: right" class="count">(' . $term->count . ')</span> </a>
683
+ </li>';
684
+ }
685
+ echo '</ul>';
686
+ }
687
+ ?>
688
+ </div>
689
+ <?php
690
+ }
691
+
692
+ endif;
693
+ /**
694
+ * Return the currently viewed term slug.
695
+ *
696
+ * @return int
697
+ */
698
+ function dokan_get_current_term_slug() {
699
+ return absint( is_tax() ? get_queried_object()->slug : 0 );
700
+ }
701
+
702
+ /**
703
+ * Get chosen taxonomy attributes.
704
+ *
705
+ * @since 3.5.0
706
+ *
707
+ * @return array
708
+ */
709
+ function dokan_get_chosen_taxonomy_attributes() {
710
+ $attributes = [];
711
+ // phpcs:disable WordPress.Security.NonceVerification.Recommended
712
+ if ( empty( $_GET ) ) {
713
+ return $attributes;
714
+ }
715
+
716
+ foreach ( $_GET as $key => $value ) {
717
+ if ( 0 !== strpos( $key, 'filter_' ) ) {
718
+ continue;
719
+ }
720
+
721
+ $attribute = wc_sanitize_taxonomy_name( str_replace( 'filter_', '', $key ) );
722
+ $taxonomy = wc_attribute_taxonomy_name( $attribute );
723
+ $filter_terms = ! empty( $value ) ? explode( ',', wc_clean( wp_unslash( $value ) ) ) : [];
724
+
725
+ if ( empty( $filter_terms ) || ! taxonomy_exists( $taxonomy ) || ! wc_attribute_taxonomy_id_by_name( $attribute ) ) {
726
+ continue;
727
+ }
728
+
729
+ // phpcs:ignore
730
+ $query_type = ! empty( $_GET['query_type_' . $attribute] ) && in_array( $_GET['query_type_' . $attribute], [ 'and', 'or' ], true ) ? wc_clean( wp_unslash( $_GET['query_type_' . $attribute] ) ) : '';
731
+ $attributes[ $taxonomy ]['terms'] = array_map( 'sanitize_title', $filter_terms ); // Ensures correct encoding.
732
+ $attributes[ $taxonomy ]['query_type'] = $query_type ? $query_type : 'and';
733
+ }
734
+ // phpcs:enable WordPress.Security.NonceVerification.Recommended
735
+ return $attributes;
736
+ }
737
 
738
  function dokan_seller_reg_form_fields() {
739
  $postdata = wc_clean( $_POST ); //phpcs:ignore
languages/dokan-lite.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the GPL2.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Dokan 3.4.3\n"
6
  "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
7
- "POT-Creation-Date: 2022-04-26 08:58:29+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -52,7 +52,7 @@ msgstr ""
52
 
53
  #: dokan.php:477 includes/Admin/AdminBar.php:81 includes/Admin/Menu.php:66
54
  #: includes/Dashboard/Templates/Settings.php:59
55
- #: includes/Dashboard/Templates/Settings.php:66 includes/template-tags.php:417
56
  #: src/admin/pages/Settings.vue:4
57
  msgid "Settings"
58
  msgstr ""
@@ -121,13 +121,13 @@ msgstr ""
121
 
122
  #: includes/Admin/AdminBar.php:54 includes/Admin/Menu.php:45
123
  #: includes/Admin/Settings.php:527 includes/Install/Installer.php:172
124
- #: includes/template-tags.php:386 src/admin/pages/Dashboard.vue:3
125
  msgid "Dashboard"
126
  msgstr ""
127
 
128
  #: includes/Admin/AdminBar.php:63 includes/Admin/Menu.php:34
129
  #: includes/Admin/Menu.php:46 includes/Admin/SetupWizard.php:160
130
- #: includes/functions.php:2979 includes/template-tags.php:408
131
  #: templates/withdraw/header.php:11
132
  msgid "Withdraw"
133
  msgstr ""
@@ -930,7 +930,7 @@ msgid "Introduction"
930
  msgstr ""
931
 
932
  #: includes/Admin/SetupWizard.php:150 includes/Vendor/SetupWizard.php:75
933
- #: includes/template-tags.php:431
934
  msgid "Store"
935
  msgstr ""
936
 
@@ -1084,7 +1084,7 @@ msgid "Error installing WooCommerce plugin"
1084
  msgstr ""
1085
 
1086
  #: includes/Admin/SetupWizardNoWC.php:176 includes/Vendor/SetupWizard.php:80
1087
- #: includes/template-tags.php:438
1088
  msgid "Payment"
1089
  msgstr ""
1090
 
@@ -1408,7 +1408,7 @@ msgstr ""
1408
  msgid "Please provide your email."
1409
  msgstr ""
1410
 
1411
- #: includes/Ajax.php:343 includes/template-tags.php:165
1412
  msgid "Something went wrong!"
1413
  msgstr ""
1414
 
@@ -3471,7 +3471,7 @@ msgstr ""
3471
  msgid "Total"
3472
  msgstr ""
3473
 
3474
- #: includes/REST/AdminReportController.php:150 includes/template-tags.php:400
3475
  #: templates/dashboard/orders-widget.php:15
3476
  msgid "Orders"
3477
  msgstr ""
@@ -4720,25 +4720,25 @@ msgstr ""
4720
  msgid "Switched back to %1$s (%2$s)."
4721
  msgstr ""
4722
 
4723
- #: includes/Vendor/Vendor.php:851
4724
  msgid "No ratings found yet!"
4725
  msgstr ""
4726
 
4727
- #: includes/Vendor/Vendor.php:853
4728
  msgid "%s rating from %d review"
4729
  msgid_plural "%s rating from %d reviews"
4730
  msgstr[0] ""
4731
  msgstr[1] ""
4732
 
4733
- #: includes/Vendor/Vendor.php:854
4734
  msgid "Rated %s out of %d"
4735
  msgstr ""
4736
 
4737
- #: includes/Vendor/Vendor.php:985 templates/settings/store-form.php:283
4738
  msgid "Store is open"
4739
  msgstr ""
4740
 
4741
- #: includes/Vendor/Vendor.php:999 templates/settings/store-form.php:291
4742
  msgid "Store is closed"
4743
  msgstr ""
4744
 
@@ -4747,6 +4747,7 @@ msgid "Best Selling Product"
4747
  msgstr ""
4748
 
4749
  #: includes/Widgets/BestSellingProducts.php:72
 
4750
  #: includes/Widgets/ProductCategoryMenu.php:99
4751
  #: includes/Widgets/StoreCategoryMenu.php:87
4752
  #: includes/Widgets/StoreContactForm.php:126
@@ -4770,6 +4771,34 @@ msgstr ""
4770
  msgid "Hide Out of Stock"
4771
  msgstr ""
4772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4773
  #: includes/Widgets/ProductCategoryMenu.php:18
4774
  msgid "Dokan product category menu"
4775
  msgstr ""
@@ -4787,7 +4816,7 @@ msgid "Dokan: Store Product Category Menu"
4787
  msgstr ""
4788
 
4789
  #: includes/Widgets/StoreCategoryMenu.php:36
4790
- #: includes/Widgets/StoreCategoryMenu.php:80 includes/template-tags.php:712
4791
  msgid "Store Product Category"
4792
  msgstr ""
4793
 
@@ -4800,7 +4829,7 @@ msgid "Dokan: Store Contact Form"
4800
  msgstr ""
4801
 
4802
  #: includes/Widgets/StoreContactForm.php:42
4803
- #: includes/Widgets/StoreContactForm.php:119 includes/template-tags.php:751
4804
  msgid "Contact Vendor"
4805
  msgstr ""
4806
 
@@ -4813,7 +4842,7 @@ msgid "Dokan: Store Location"
4813
  msgstr ""
4814
 
4815
  #: includes/Widgets/StoreLocation.php:42 includes/Widgets/StoreLocation.php:103
4816
- #: includes/template-tags.php:725
4817
  msgid "Store Location"
4818
  msgstr ""
4819
 
@@ -4826,7 +4855,7 @@ msgid "Dokan: Store Opening Closing Time Widget"
4826
  msgstr ""
4827
 
4828
  #: includes/Widgets/StoreOpenClose.php:41
4829
- #: includes/Widgets/StoreOpenClose.php:112 includes/template-tags.php:738
4830
  msgid "Store Time"
4831
  msgstr ""
4832
 
@@ -5004,7 +5033,7 @@ msgstr ""
5004
  msgid "Author"
5005
  msgstr ""
5006
 
5007
- #: includes/functions.php:1301 includes/template-tags.php:393
5008
  #: src/admin/pages/Dashboard.vue:54 templates/dashboard/products-widget.php:16
5009
  msgid "Products"
5010
  msgstr ""
@@ -5371,74 +5400,74 @@ msgstr ""
5371
  msgid "Sales"
5372
  msgstr ""
5373
 
5374
- #: includes/template-tags.php:119 includes/template-tags.php:123
5375
  #: templates/store-lists-loop.php:116
5376
  msgid "&larr; Previous"
5377
  msgstr ""
5378
 
5379
- #: includes/template-tags.php:135 templates/store-lists-loop.php:117
5380
  msgid "Next &rarr;"
5381
  msgstr ""
5382
 
5383
- #: includes/template-tags.php:156
5384
  msgid "Product successfully deleted"
5385
  msgstr ""
5386
 
5387
- #: includes/template-tags.php:232
5388
  #: templates/products/listing-status-filter.php:13
5389
  #. translators: %d : order count total
5390
  msgid "All (%d)"
5391
  msgstr ""
5392
 
5393
- #: includes/template-tags.php:250
5394
  #. translators: %d : order count completed status
5395
  msgid "Completed (%d)"
5396
  msgstr ""
5397
 
5398
- #: includes/template-tags.php:268
5399
  #. translators: %d : order count processing status
5400
  msgid "Processing (%d)"
5401
  msgstr ""
5402
 
5403
- #: includes/template-tags.php:286
5404
  #. translators: %d : order count on hold status
5405
  msgid "On-hold (%d)"
5406
  msgstr ""
5407
 
5408
- #: includes/template-tags.php:304
5409
  #. translators: %d : order count pending status
5410
  msgid "Pending (%d)"
5411
  msgstr ""
5412
 
5413
- #: includes/template-tags.php:322
5414
  #. translators: %d : order count cancelled status
5415
  msgid "Cancelled (%d)"
5416
  msgstr ""
5417
 
5418
- #: includes/template-tags.php:340
5419
  #. translators: %d : order count refunded status
5420
  msgid "Refunded (%d)"
5421
  msgstr ""
5422
 
5423
- #: includes/template-tags.php:359
5424
  #. translators: %d : order count failed status
5425
  msgid "Failed (%d)"
5426
  msgstr ""
5427
 
5428
- #: includes/template-tags.php:425
5429
  msgid "Back to Dashboard"
5430
  msgstr ""
5431
 
5432
- #: includes/template-tags.php:564 templates/settings/header.php:14
5433
  #: templates/store-lists-loop.php:92
5434
  msgid "Visit Store"
5435
  msgstr ""
5436
 
5437
- #: includes/template-tags.php:565 templates/global/header-menu.php:48
5438
  msgid "Edit Account"
5439
  msgstr ""
5440
 
5441
- #: includes/template-tags.php:566
5442
  msgid "Log out"
5443
  msgstr ""
5444
 
@@ -8468,12 +8497,12 @@ msgctxt "number of pages"
8468
  msgid "of"
8469
  msgstr ""
8470
 
8471
- #: includes/template-tags.php:48
8472
  msgctxt "Previous post link"
8473
  msgid "&larr;"
8474
  msgstr ""
8475
 
8476
- #: includes/template-tags.php:51
8477
  msgctxt "Next post link"
8478
  msgid "&rarr;"
8479
  msgstr ""
2
  # This file is distributed under the GPL2.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Dokan 3.5.0\n"
6
  "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
7
+ "POT-Creation-Date: 2022-05-17 15:00:34+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
52
 
53
  #: dokan.php:477 includes/Admin/AdminBar.php:81 includes/Admin/Menu.php:66
54
  #: includes/Dashboard/Templates/Settings.php:59
55
+ #: includes/Dashboard/Templates/Settings.php:66 includes/template-tags.php:419
56
  #: src/admin/pages/Settings.vue:4
57
  msgid "Settings"
58
  msgstr ""
121
 
122
  #: includes/Admin/AdminBar.php:54 includes/Admin/Menu.php:45
123
  #: includes/Admin/Settings.php:527 includes/Install/Installer.php:172
124
+ #: includes/template-tags.php:388 src/admin/pages/Dashboard.vue:3
125
  msgid "Dashboard"
126
  msgstr ""
127
 
128
  #: includes/Admin/AdminBar.php:63 includes/Admin/Menu.php:34
129
  #: includes/Admin/Menu.php:46 includes/Admin/SetupWizard.php:160
130
+ #: includes/functions.php:2979 includes/template-tags.php:410
131
  #: templates/withdraw/header.php:11
132
  msgid "Withdraw"
133
  msgstr ""
930
  msgstr ""
931
 
932
  #: includes/Admin/SetupWizard.php:150 includes/Vendor/SetupWizard.php:75
933
+ #: includes/template-tags.php:433
934
  msgid "Store"
935
  msgstr ""
936
 
1084
  msgstr ""
1085
 
1086
  #: includes/Admin/SetupWizardNoWC.php:176 includes/Vendor/SetupWizard.php:80
1087
+ #: includes/template-tags.php:440
1088
  msgid "Payment"
1089
  msgstr ""
1090
 
1408
  msgid "Please provide your email."
1409
  msgstr ""
1410
 
1411
+ #: includes/Ajax.php:343 includes/template-tags.php:167
1412
  msgid "Something went wrong!"
1413
  msgstr ""
1414
 
3471
  msgid "Total"
3472
  msgstr ""
3473
 
3474
+ #: includes/REST/AdminReportController.php:150 includes/template-tags.php:402
3475
  #: templates/dashboard/orders-widget.php:15
3476
  msgid "Orders"
3477
  msgstr ""
4720
  msgid "Switched back to %1$s (%2$s)."
4721
  msgstr ""
4722
 
4723
+ #: includes/Vendor/Vendor.php:916
4724
  msgid "No ratings found yet!"
4725
  msgstr ""
4726
 
4727
+ #: includes/Vendor/Vendor.php:918
4728
  msgid "%s rating from %d review"
4729
  msgid_plural "%s rating from %d reviews"
4730
  msgstr[0] ""
4731
  msgstr[1] ""
4732
 
4733
+ #: includes/Vendor/Vendor.php:919
4734
  msgid "Rated %s out of %d"
4735
  msgstr ""
4736
 
4737
+ #: includes/Vendor/Vendor.php:1050 templates/settings/store-form.php:283
4738
  msgid "Store is open"
4739
  msgstr ""
4740
 
4741
+ #: includes/Vendor/Vendor.php:1064 templates/settings/store-form.php:291
4742
  msgid "Store is closed"
4743
  msgstr ""
4744
 
4747
  msgstr ""
4748
 
4749
  #: includes/Widgets/BestSellingProducts.php:72
4750
+ #: includes/Widgets/FilterByAttributes.php:106
4751
  #: includes/Widgets/ProductCategoryMenu.php:99
4752
  #: includes/Widgets/StoreCategoryMenu.php:87
4753
  #: includes/Widgets/StoreContactForm.php:126
4771
  msgid "Hide Out of Stock"
4772
  msgstr ""
4773
 
4774
+ #: includes/Widgets/FilterByAttributes.php:15
4775
+ msgid "Dokan: Filter Products by Attribute Widget"
4776
+ msgstr ""
4777
+
4778
+ #: includes/Widgets/FilterByAttributes.php:17
4779
+ msgid "A Widget for displaying products by attribute for dokan"
4780
+ msgstr ""
4781
+
4782
+ #: includes/Widgets/FilterByAttributes.php:81
4783
+ msgid "Filter by"
4784
+ msgstr ""
4785
+
4786
+ #: includes/Widgets/FilterByAttributes.php:99
4787
+ msgid "AND"
4788
+ msgstr ""
4789
+
4790
+ #: includes/Widgets/FilterByAttributes.php:100
4791
+ msgid "OR"
4792
+ msgstr ""
4793
+
4794
+ #: includes/Widgets/FilterByAttributes.php:110
4795
+ msgid "Attribute"
4796
+ msgstr ""
4797
+
4798
+ #: includes/Widgets/FilterByAttributes.php:118
4799
+ msgid "Query Type"
4800
+ msgstr ""
4801
+
4802
  #: includes/Widgets/ProductCategoryMenu.php:18
4803
  msgid "Dokan product category menu"
4804
  msgstr ""
4816
  msgstr ""
4817
 
4818
  #: includes/Widgets/StoreCategoryMenu.php:36
4819
+ #: includes/Widgets/StoreCategoryMenu.php:80 includes/template-tags.php:838
4820
  msgid "Store Product Category"
4821
  msgstr ""
4822
 
4829
  msgstr ""
4830
 
4831
  #: includes/Widgets/StoreContactForm.php:42
4832
+ #: includes/Widgets/StoreContactForm.php:119 includes/template-tags.php:877
4833
  msgid "Contact Vendor"
4834
  msgstr ""
4835
 
4842
  msgstr ""
4843
 
4844
  #: includes/Widgets/StoreLocation.php:42 includes/Widgets/StoreLocation.php:103
4845
+ #: includes/template-tags.php:851
4846
  msgid "Store Location"
4847
  msgstr ""
4848
 
4855
  msgstr ""
4856
 
4857
  #: includes/Widgets/StoreOpenClose.php:41
4858
+ #: includes/Widgets/StoreOpenClose.php:112 includes/template-tags.php:864
4859
  msgid "Store Time"
4860
  msgstr ""
4861
 
5033
  msgid "Author"
5034
  msgstr ""
5035
 
5036
+ #: includes/functions.php:1301 includes/template-tags.php:395
5037
  #: src/admin/pages/Dashboard.vue:54 templates/dashboard/products-widget.php:16
5038
  msgid "Products"
5039
  msgstr ""
5400
  msgid "Sales"
5401
  msgstr ""
5402
 
5403
+ #: includes/template-tags.php:121 includes/template-tags.php:125
5404
  #: templates/store-lists-loop.php:116
5405
  msgid "&larr; Previous"
5406
  msgstr ""
5407
 
5408
+ #: includes/template-tags.php:137 templates/store-lists-loop.php:117
5409
  msgid "Next &rarr;"
5410
  msgstr ""
5411
 
5412
+ #: includes/template-tags.php:158
5413
  msgid "Product successfully deleted"
5414
  msgstr ""
5415
 
5416
+ #: includes/template-tags.php:234
5417
  #: templates/products/listing-status-filter.php:13
5418
  #. translators: %d : order count total
5419
  msgid "All (%d)"
5420
  msgstr ""
5421
 
5422
+ #: includes/template-tags.php:252
5423
  #. translators: %d : order count completed status
5424
  msgid "Completed (%d)"
5425
  msgstr ""
5426
 
5427
+ #: includes/template-tags.php:270
5428
  #. translators: %d : order count processing status
5429
  msgid "Processing (%d)"
5430
  msgstr ""
5431
 
5432
+ #: includes/template-tags.php:288
5433
  #. translators: %d : order count on hold status
5434
  msgid "On-hold (%d)"
5435
  msgstr ""
5436
 
5437
+ #: includes/template-tags.php:306
5438
  #. translators: %d : order count pending status
5439
  msgid "Pending (%d)"
5440
  msgstr ""
5441
 
5442
+ #: includes/template-tags.php:324
5443
  #. translators: %d : order count cancelled status
5444
  msgid "Cancelled (%d)"
5445
  msgstr ""
5446
 
5447
+ #: includes/template-tags.php:342
5448
  #. translators: %d : order count refunded status
5449
  msgid "Refunded (%d)"
5450
  msgstr ""
5451
 
5452
+ #: includes/template-tags.php:361
5453
  #. translators: %d : order count failed status
5454
  msgid "Failed (%d)"
5455
  msgstr ""
5456
 
5457
+ #: includes/template-tags.php:427
5458
  msgid "Back to Dashboard"
5459
  msgstr ""
5460
 
5461
+ #: includes/template-tags.php:566 templates/settings/header.php:14
5462
  #: templates/store-lists-loop.php:92
5463
  msgid "Visit Store"
5464
  msgstr ""
5465
 
5466
+ #: includes/template-tags.php:567 templates/global/header-menu.php:48
5467
  msgid "Edit Account"
5468
  msgstr ""
5469
 
5470
+ #: includes/template-tags.php:568
5471
  msgid "Log out"
5472
  msgstr ""
5473
 
8497
  msgid "of"
8498
  msgstr ""
8499
 
8500
+ #: includes/template-tags.php:50
8501
  msgctxt "Previous post link"
8502
  msgid "&larr;"
8503
  msgstr ""
8504
 
8505
+ #: includes/template-tags.php:53
8506
  msgctxt "Next post link"
8507
  msgid "&rarr;"
8508
  msgstr ""
readme.txt CHANGED
@@ -2,12 +2,12 @@
2
  Contributors: tareq1988, wedevs, nizamuddinbabu
3
  Donate Link: http://tareq.co/donate/
4
  Tags: WooCommerce multivendor marketplace, multi vendor marketplace, multi seller store, multi-vendor, multi seller, commissions, multivendor, marketplace, product vendors, woocommerce vendor, commission rate, e-commerce, woocommerce, ebay, ecommerce, yith, yithemes
5
- Requires at least: 4.4
6
  Tested up to: 5.9.3
7
- WC requires at least: 3.0
8
- WC tested up to: 6.4.1
9
- Requires PHP: 5.6
10
- Stable tag: 3.4.3
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -314,6 +314,15 @@ A. Just install and activate the PRO version without deleting the free plugin. A
314
 
315
  == Changelog ==
316
 
 
 
 
 
 
 
 
 
 
317
  = v3.4.3 ( Apr 26, 2022 ) =
318
 
319
  - **fix:** Store Contact Form widget submits the contact form directly instead of ajax submission
2
  Contributors: tareq1988, wedevs, nizamuddinbabu
3
  Donate Link: http://tareq.co/donate/
4
  Tags: WooCommerce multivendor marketplace, multi vendor marketplace, multi seller store, multi-vendor, multi seller, commissions, multivendor, marketplace, product vendors, woocommerce vendor, commission rate, e-commerce, woocommerce, ebay, ecommerce, yith, yithemes
5
+ Requires at least: 5.4
6
  Tested up to: 5.9.3
7
+ WC requires at least: 5.0.0
8
+ WC tested up to: 6.5.1
9
+ Requires PHP: 7.0
10
+ Stable tag: 3.5.0
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
314
 
315
  == Changelog ==
316
 
317
+ = v3.5.0 ( May 18, 2022 ) =
318
+
319
+ - **chore:** Minimum php version is set to 7.0
320
+ - **chore:** Minimum WooCommerce version is set to 5.0
321
+ - **chore:** Minimum WordPress version is set to 5.4
322
+ - **new:** Added a new product attributes widget, by which users/customers will be able to search products by vendors used attributes.
323
+ - **fix:** Fixed vendor store settings page phone number validation js console error
324
+ - **fix:** payment settings page 404 if dashboard url slug is changed
325
+
326
  = v3.4.3 ( Apr 26, 2022 ) =
327
 
328
  - **fix:** Store Contact Form widget submits the contact form directly instead of ajax submission
templates/settings/bank-payment-method-settings.php CHANGED
@@ -111,7 +111,7 @@
111
  <div class="dokan-text-left">
112
  <span class="display-block"><b><?php esc_html_e( 'Please double-check your account information!', 'dokan-lite' ); ?></b></span>
113
  <br/>
114
- <span class="display-block"><?php esc_html_e( 'Incorrect or mismatched account name and number can result in withdrawal delays and fees', 'dokan-lite' ); ?></>
115
  </div>
116
  </div>
117
 
@@ -121,7 +121,7 @@
121
  <button class="ajax_prev dokan-btn dokan-btn-theme" type="submit" name="dokan_update_payment_settings">
122
  <?php echo esc_html( $save_or_add_btn_text ); ?>
123
  </button>
124
- <a href="<?php echo esc_url( home_url( '/dashboard/settings/payment/' ) ); ?>">
125
  <?php esc_html_e( 'Cancel', 'dokan-lite' ); ?>
126
  </a>
127
  </div>
111
  <div class="dokan-text-left">
112
  <span class="display-block"><b><?php esc_html_e( 'Please double-check your account information!', 'dokan-lite' ); ?></b></span>
113
  <br/>
114
+ <span class="display-block"><?php esc_html_e( 'Incorrect or mismatched account name and number can result in withdrawal delays and fees', 'dokan-lite' ); ?></span>
115
  </div>
116
  </div>
117
 
121
  <button class="ajax_prev dokan-btn dokan-btn-theme" type="submit" name="dokan_update_payment_settings">
122
  <?php echo esc_html( $save_or_add_btn_text ); ?>
123
  </button>
124
+ <a href="<?php echo esc_url( dokan_get_page_url( 'dashboard', 'dokan', 'settings/payment' ) ); ?>">
125
  <?php esc_html_e( 'Cancel', 'dokan-lite' ); ?>
126
  </a>
127
  </div>
templates/settings/payment.php CHANGED
@@ -22,7 +22,7 @@ do_action( 'dokan_payment_settings_before_form', $current_user, $profile_info );
22
  <ul>
23
  <?php foreach ( $unused_methods as $method_key => $method ) :?>
24
  <li>
25
- <a href="<?php echo esc_url( home_url( "dashboard/settings/payment/manage-" . $method_key ) ); ?>">
26
  <div>
27
  <img src="<?php echo esc_url( dokan_withdraw_get_method_icon( $method_key ) ); ?>" alt="<?php echo esc_attr( $method_key ); ?>" />
28
  <span>
@@ -65,7 +65,7 @@ do_action( 'dokan_payment_settings_before_form', $current_user, $profile_info );
65
  </span>
66
  </div>
67
  <div>
68
- <a href="<?php echo esc_url( home_url( "dashboard/settings/payment/manage-" . $method_key . "/edit" ) ); ?>">
69
  <button class="dokan-btn-theme dokan-btn-sm"><?php esc_html_e( 'Manage', 'dokan-lite' ); ?></button>
70
  </a>
71
  </div>
22
  <ul>
23
  <?php foreach ( $unused_methods as $method_key => $method ) :?>
24
  <li>
25
+ <a href="<?php echo esc_url( dokan_get_page_url( 'dashboard', 'dokan', 'settings/payment/manage-' . $method_key ) ); ?>">
26
  <div>
27
  <img src="<?php echo esc_url( dokan_withdraw_get_method_icon( $method_key ) ); ?>" alt="<?php echo esc_attr( $method_key ); ?>" />
28
  <span>
65
  </span>
66
  </div>
67
  <div>
68
+ <a href="<?php echo esc_url( dokan_get_page_url( 'dashboard', 'dokan', 'settings/payment/manage-' . $method_key . '/edit' ) ); ?>">
69
  <button class="dokan-btn-theme dokan-btn-sm"><?php esc_html_e( 'Manage', 'dokan-lite' ); ?></button>
70
  </a>
71
  </div>
templates/settings/store-form.php CHANGED
@@ -484,23 +484,39 @@
484
  dokan_address_select.init();
485
 
486
  $('#setting_phone').on( 'keydown', function(e) {
487
- // Allow: backspace, delete, tab, escape, enter and .
488
- if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 91, 107, 109, 110, 187, 189, 190]) !== -1 ||
489
- // Allow: Ctrl+A
 
 
 
 
 
 
 
 
 
 
 
490
  (e.keyCode == 65 && e.ctrlKey === true) ||
491
  //Allow Ctrl+v
492
  (e.keyCode === vKey && ctrlDown) ||
493
  // Allow: Ctrl+c
494
  (e.keyCode === cKey && ctrlDown) ||
495
- // Allow: home, end, left, right
496
- (e.keyCode >= 35 && e.keyCode <= 39)) {
497
- // let it happen, don't do anything
 
498
  return;
499
  }
500
 
501
- // Ensure that it is a number and stop the keypress
502
- if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
503
- e.preventDefault();
 
 
 
 
504
  }
505
  });
506
  });
484
  dokan_address_select.init();
485
 
486
  $('#setting_phone').on( 'keydown', function(e) {
487
+ let cKey = 67,
488
+ vKey = 86,
489
+ cmdKey = 91,
490
+ ctrlKey = 17,
491
+ ctrlDown = false;
492
+
493
+ if (e.keyCode === ctrlKey || e.keyCode === cmdKey) {
494
+ ctrlDown = true;
495
+ }
496
+
497
+ if (
498
+ // Allow: backspace, delete, tab, escape, enter etc.
499
+ $.inArray(e.keyCode, [46, 48, 53, 57, 8, 9, 27, 13, 91, 107, 109, 110, 187, 189, 190]) !== -1 ||
500
+ // Allow: Ctrl+A
501
  (e.keyCode == 65 && e.ctrlKey === true) ||
502
  //Allow Ctrl+v
503
  (e.keyCode === vKey && ctrlDown) ||
504
  // Allow: Ctrl+c
505
  (e.keyCode === cKey && ctrlDown) ||
506
+ // Allow: home, end, left, right.
507
+ (e.keyCode >= 35 && e.keyCode <= 39)
508
+ ) {
509
+ // Let it happen, don't do anything.
510
  return;
511
  }
512
 
513
+ if ( ( e.shiftKey && ! isNaN( Number(e.key) ) ) ) {
514
+ return;
515
+ }
516
+
517
+ // Ensure that it is a number and stop the keypress.
518
+ if ( isNaN( Number(e.key) ) ) {
519
+ e.preventDefault();
520
  }
521
  });
522
  });
templates/whats-new.php CHANGED
@@ -3,6 +3,28 @@
3
  * When you are adding new version please follow this sequence for changes: New Feature, New, Improvement, Fix...
4
  */
5
  $changelog = [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  [
7
  'version' => 'Version 3.4.3',
8
  'released' => '2022-04-26',
3
  * When you are adding new version please follow this sequence for changes: New Feature, New, Improvement, Fix...
4
  */
5
  $changelog = [
6
+ [
7
+ 'version' => 'Version 3.5.0',
8
+ 'released' => '2022-05-18',
9
+ 'changes' => [
10
+ 'New' => [
11
+ [
12
+ 'title' => 'Added a new product attributes widget, by which users/customers will be able to search products by vendors used attributes.',
13
+ 'description' => '',
14
+ ],
15
+ ],
16
+ 'Fix' => [
17
+ [
18
+ 'title' => 'Fixed vendor store settings page phone number validation js console error.',
19
+ 'description' => '',
20
+ ],
21
+ [
22
+ 'title' => 'Payment settings page 404 if dashboard url slug is changed.',
23
+ 'description' => '',
24
+ ],
25
+ ],
26
+ ],
27
+ ],
28
  [
29
  'version' => 'Version 3.4.3',
30
  'released' => '2022-04-26',
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit7fbc1a3b652a4af458bfe82e49b2afd6::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit552fb3424bdcd130dd37a0d8da302ba1::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -166,6 +166,7 @@ return array(
166
  'WeDevs\\Dokan\\Walkers\\StoreCategory' => $baseDir . '/includes/Walkers/StoreCategory.php',
167
  'WeDevs\\Dokan\\Walkers\\TaxonomyDropdown' => $baseDir . '/includes/Walkers/TaxonomyDropdown.php',
168
  'WeDevs\\Dokan\\Widgets\\BestSellingProducts' => $baseDir . '/includes/Widgets/BestSellingProducts.php',
 
169
  'WeDevs\\Dokan\\Widgets\\Manager' => $baseDir . '/includes/Widgets/Manager.php',
170
  'WeDevs\\Dokan\\Widgets\\ProductCategoryMenu' => $baseDir . '/includes/Widgets/ProductCategoryMenu.php',
171
  'WeDevs\\Dokan\\Widgets\\StoreCategoryMenu' => $baseDir . '/includes/Widgets/StoreCategoryMenu.php',
166
  'WeDevs\\Dokan\\Walkers\\StoreCategory' => $baseDir . '/includes/Walkers/StoreCategory.php',
167
  'WeDevs\\Dokan\\Walkers\\TaxonomyDropdown' => $baseDir . '/includes/Walkers/TaxonomyDropdown.php',
168
  'WeDevs\\Dokan\\Widgets\\BestSellingProducts' => $baseDir . '/includes/Widgets/BestSellingProducts.php',
169
+ 'WeDevs\\Dokan\\Widgets\\FilterByAttributes' => $baseDir . '/includes/Widgets/FilterByAttributes.php',
170
  'WeDevs\\Dokan\\Widgets\\Manager' => $baseDir . '/includes/Widgets/Manager.php',
171
  'WeDevs\\Dokan\\Widgets\\ProductCategoryMenu' => $baseDir . '/includes/Widgets/ProductCategoryMenu.php',
172
  'WeDevs\\Dokan\\Widgets\\StoreCategoryMenu' => $baseDir . '/includes/Widgets/StoreCategoryMenu.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit7fbc1a3b652a4af458bfe82e49b2afd6
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit7fbc1a3b652a4af458bfe82e49b2afd6
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit7fbc1a3b652a4af458bfe82e49b2afd6', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit7fbc1a3b652a4af458bfe82e49b2afd6', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
- call_user_func(\Composer\Autoload\ComposerStaticInit7fbc1a3b652a4af458bfe82e49b2afd6::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
@@ -53,12 +53,12 @@ class ComposerAutoloaderInit7fbc1a3b652a4af458bfe82e49b2afd6
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
- $includeFiles = Composer\Autoload\ComposerStaticInit7fbc1a3b652a4af458bfe82e49b2afd6::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
- composerRequire7fbc1a3b652a4af458bfe82e49b2afd6($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
@@ -70,7 +70,7 @@ class ComposerAutoloaderInit7fbc1a3b652a4af458bfe82e49b2afd6
70
  * @param string $file
71
  * @return void
72
  */
73
- function composerRequire7fbc1a3b652a4af458bfe82e49b2afd6($fileIdentifier, $file)
74
  {
75
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
76
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit552fb3424bdcd130dd37a0d8da302ba1
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInit552fb3424bdcd130dd37a0d8da302ba1', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit552fb3424bdcd130dd37a0d8da302ba1', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInit552fb3424bdcd130dd37a0d8da302ba1::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
+ $includeFiles = Composer\Autoload\ComposerStaticInit552fb3424bdcd130dd37a0d8da302ba1::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
+ composerRequire552fb3424bdcd130dd37a0d8da302ba1($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
70
  * @param string $file
71
  * @return void
72
  */
73
+ function composerRequire552fb3424bdcd130dd37a0d8da302ba1($fileIdentifier, $file)
74
  {
75
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
76
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit7fbc1a3b652a4af458bfe82e49b2afd6
8
  {
9
  public static $files = array (
10
  'b45b351e6b6f7487d819961fef2fda77' => __DIR__ . '/..' . '/jakeasmith/http_build_url/src/http_build_url.php',
@@ -193,6 +193,7 @@ class ComposerStaticInit7fbc1a3b652a4af458bfe82e49b2afd6
193
  'WeDevs\\Dokan\\Walkers\\StoreCategory' => __DIR__ . '/../..' . '/includes/Walkers/StoreCategory.php',
194
  'WeDevs\\Dokan\\Walkers\\TaxonomyDropdown' => __DIR__ . '/../..' . '/includes/Walkers/TaxonomyDropdown.php',
195
  'WeDevs\\Dokan\\Widgets\\BestSellingProducts' => __DIR__ . '/../..' . '/includes/Widgets/BestSellingProducts.php',
 
196
  'WeDevs\\Dokan\\Widgets\\Manager' => __DIR__ . '/../..' . '/includes/Widgets/Manager.php',
197
  'WeDevs\\Dokan\\Widgets\\ProductCategoryMenu' => __DIR__ . '/../..' . '/includes/Widgets/ProductCategoryMenu.php',
198
  'WeDevs\\Dokan\\Widgets\\StoreCategoryMenu' => __DIR__ . '/../..' . '/includes/Widgets/StoreCategoryMenu.php',
@@ -212,9 +213,9 @@ class ComposerStaticInit7fbc1a3b652a4af458bfe82e49b2afd6
212
  public static function getInitializer(ClassLoader $loader)
213
  {
214
  return \Closure::bind(function () use ($loader) {
215
- $loader->prefixLengthsPsr4 = ComposerStaticInit7fbc1a3b652a4af458bfe82e49b2afd6::$prefixLengthsPsr4;
216
- $loader->prefixDirsPsr4 = ComposerStaticInit7fbc1a3b652a4af458bfe82e49b2afd6::$prefixDirsPsr4;
217
- $loader->classMap = ComposerStaticInit7fbc1a3b652a4af458bfe82e49b2afd6::$classMap;
218
 
219
  }, null, ClassLoader::class);
220
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit552fb3424bdcd130dd37a0d8da302ba1
8
  {
9
  public static $files = array (
10
  'b45b351e6b6f7487d819961fef2fda77' => __DIR__ . '/..' . '/jakeasmith/http_build_url/src/http_build_url.php',
193
  'WeDevs\\Dokan\\Walkers\\StoreCategory' => __DIR__ . '/../..' . '/includes/Walkers/StoreCategory.php',
194
  'WeDevs\\Dokan\\Walkers\\TaxonomyDropdown' => __DIR__ . '/../..' . '/includes/Walkers/TaxonomyDropdown.php',
195
  'WeDevs\\Dokan\\Widgets\\BestSellingProducts' => __DIR__ . '/../..' . '/includes/Widgets/BestSellingProducts.php',
196
+ 'WeDevs\\Dokan\\Widgets\\FilterByAttributes' => __DIR__ . '/../..' . '/includes/Widgets/FilterByAttributes.php',
197
  'WeDevs\\Dokan\\Widgets\\Manager' => __DIR__ . '/../..' . '/includes/Widgets/Manager.php',
198
  'WeDevs\\Dokan\\Widgets\\ProductCategoryMenu' => __DIR__ . '/../..' . '/includes/Widgets/ProductCategoryMenu.php',
199
  'WeDevs\\Dokan\\Widgets\\StoreCategoryMenu' => __DIR__ . '/../..' . '/includes/Widgets/StoreCategoryMenu.php',
213
  public static function getInitializer(ClassLoader $loader)
214
  {
215
  return \Closure::bind(function () use ($loader) {
216
+ $loader->prefixLengthsPsr4 = ComposerStaticInit552fb3424bdcd130dd37a0d8da302ba1::$prefixLengthsPsr4;
217
+ $loader->prefixDirsPsr4 = ComposerStaticInit552fb3424bdcd130dd37a0d8da302ba1::$prefixDirsPsr4;
218
+ $loader->classMap = ComposerStaticInit552fb3424bdcd130dd37a0d8da302ba1::$classMap;
219
 
220
  }, null, ClassLoader::class);
221
  }