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

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.3.8
Comparing to
See all releases

Code changes from version 3.3.7 to 3.3.8

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.3.7
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.1.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.3.7';
60
 
61
  /**
62
  * Instance of self
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.3.8
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.2.0
12
  * Domain Path: /languages/
13
  * License: GPL2
14
  */
56
  *
57
  * @var string
58
  */
59
+ public $version = '3.3.8';
60
 
61
  /**
62
  * Instance of self
includes/Dashboard/Templates/Settings.php CHANGED
@@ -547,8 +547,8 @@ class Settings {
547
  if ( empty( $opening_time ) || empty( $closing_time ) || 'open' !== $store_status ) {
548
  $dokan_store_time[ $day_key ] = [
549
  'status' => 'close',
550
- 'opening_time' => '',
551
- 'closing_time' => '',
552
  ];
553
 
554
  continue;
@@ -557,8 +557,8 @@ class Settings {
557
  // Get and set current day's data for update dokan store time. Make dokan store time data here.
558
  $dokan_store_time[ $day_key ] = [
559
  'status' => $store_status,
560
- 'opening_time' => $opening_time,
561
- 'closing_time' => $closing_time,
562
  ];
563
  }
564
 
547
  if ( empty( $opening_time ) || empty( $closing_time ) || 'open' !== $store_status ) {
548
  $dokan_store_time[ $day_key ] = [
549
  'status' => 'close',
550
+ 'opening_time' => [],
551
+ 'closing_time' => [],
552
  ];
553
 
554
  continue;
557
  // Get and set current day's data for update dokan store time. Make dokan store time data here.
558
  $dokan_store_time[ $day_key ] = [
559
  'status' => $store_status,
560
+ 'opening_time' => ( array ) $opening_time,
561
+ 'closing_time' => ( array ) $closing_time,
562
  ];
563
  }
564
 
includes/Upgrade/Upgrades.php CHANGED
@@ -36,6 +36,7 @@ class Upgrades {
36
  '3.2.12' => Upgrades\V_3_2_12::class,
37
  '3.3.1' => Upgrades\V_3_3_1::class,
38
  '3.3.7' => Upgrades\V_3_3_7::class,
 
39
  ];
40
 
41
  /**
36
  '3.2.12' => Upgrades\V_3_2_12::class,
37
  '3.3.1' => Upgrades\V_3_3_1::class,
38
  '3.3.7' => Upgrades\V_3_3_7::class,
39
+ '3.3.8' => Upgrades\V_3_3_8::class,
40
  ];
41
 
42
  /**
includes/Upgrade/Upgrades/BackgroundProcesses/V_3_3_8_VendorStoreTimes.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeDevs\Dokan\Upgrade\Upgrades\BackgroundProcesses;
4
+
5
+ use WeDevs\Dokan\Abstracts\DokanBackgroundProcesses;
6
+
7
+ /**
8
+ * Dokan vendor store times upgrader class.
9
+ *
10
+ * @since 3.3.8
11
+ */
12
+ class V_3_3_8_VendorStoreTimes extends DokanBackgroundProcesses {
13
+
14
+ /**
15
+ * Update vendors store time.
16
+ *
17
+ * @param array $vendors
18
+ *
19
+ * @since 3.3.8
20
+ *
21
+ * @return bool
22
+ */
23
+ public function task( $vendors ) {
24
+ if ( empty( $vendors ) ) {
25
+ return false;
26
+ }
27
+
28
+ foreach ( $vendors as $store_id ) {
29
+ $user_store_info = dokan_get_store_info( $store_id );
30
+
31
+ foreach ( dokan_get_translated_days() as $day => $value ) {
32
+ if ( empty( $user_store_info['dokan_store_time'][ $day ] ) ) {
33
+ $user_store_info['dokan_store_time'][ $day ] = [
34
+ 'status' => 'close',
35
+ 'opening_time' => [],
36
+ 'closing_time' => [],
37
+ ];
38
+
39
+ continue;
40
+ }
41
+
42
+ // Sets store open & close time as array value.
43
+ if ( ! is_array( $user_store_info['dokan_store_time'][ $day ]['opening_time'] ) || ! is_array( $user_store_info['dokan_store_time'][ $day ]['closing_time'] ) ) {
44
+ $user_store_info['dokan_store_time'][ $day ]['opening_time'] = (array) $user_store_info['dokan_store_time'][ $day ]['opening_time'];
45
+ $user_store_info['dokan_store_time'][ $day ]['closing_time'] = (array) $user_store_info['dokan_store_time'][ $day ]['closing_time'];
46
+ }
47
+ }
48
+
49
+ update_user_meta( $store_id, 'dokan_profile_settings', $user_store_info );
50
+ }
51
+
52
+ return false;
53
+ }
54
+ }
includes/Upgrade/Upgrades/V_3_3_8.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeDevs\Dokan\Upgrade\Upgrades;
4
+
5
+ use WeDevs\Dokan\Abstracts\DokanUpgrader;
6
+ use WeDevs\Dokan\Upgrade\Upgrades\BackgroundProcesses\V_3_3_8_VendorStoreTimes;
7
+
8
+ class V_3_3_8 extends DokanUpgrader {
9
+
10
+ /**
11
+ * Updates usermeta database table column. Before on,
12
+ * store time gets single data in usermeta. Now, we
13
+ * are setting data as array for multiple store times.
14
+ *
15
+ * @since 3.3.8
16
+ *
17
+ * @return void
18
+ */
19
+ public static function update_withdraw_table_column() {
20
+ $i = 0;
21
+ $vendors = [];
22
+ $processor = new V_3_3_8_VendorStoreTimes();
23
+
24
+ while ( null !== $vendors ) {
25
+ $args = [
26
+ 'offset' => $i++,
27
+ 'number' => 10,
28
+ 'fields' => 'ID',
29
+ ];
30
+
31
+ $vendors = dokan()->vendor->all( $args );
32
+
33
+ if ( ! empty( $vendors ) ) {
34
+ $processor->push_to_queue( $vendors );
35
+ } else {
36
+ $vendors = null;
37
+ }
38
+ }
39
+
40
+ $processor->dispatch_process();
41
+ }
42
+ }
includes/Widgets/StoreOpenClose.php CHANGED
@@ -70,10 +70,11 @@ class StoreOpenClose extends WP_Widget {
70
  }
71
 
72
  dokan_get_template_part(
73
- 'widgets/store-open-close', '', array(
74
- 'seller_id' => $seller_id,
75
  'dokan_store_time' => $dokan_store_time,
76
- )
 
77
  );
78
 
79
  echo $after_widget; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
70
  }
71
 
72
  dokan_get_template_part(
73
+ 'widgets/store-open-close', '', [
74
+ 'seller_id' => $seller_id,
75
  'dokan_store_time' => $dokan_store_time,
76
+ 'dokan_days' => dokan_get_translated_days(),
77
+ ]
78
  );
79
 
80
  echo $after_widget; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
includes/functions.php CHANGED
@@ -3185,10 +3185,6 @@ function dokan_get_translated_days( $day = '' ) {
3185
  return $all_days[ $day ];
3186
  }
3187
 
3188
- if ( 'close' === $day ) {
3189
- return apply_filters( 'dokan_store_close_day_label', __( 'Off Day', 'dokan-lite' ) );
3190
- }
3191
-
3192
  return apply_filters( 'dokan_get_translated_days', '', $day );
3193
  }
3194
 
@@ -3197,16 +3193,17 @@ function dokan_get_translated_days( $day = '' ) {
3197
  *
3198
  * @since 3.3.7
3199
  *
3200
- * @param string $current_day
3201
- * @param string $times_type eg: opening_time or closing_time
3202
- * @param int $index
 
3203
  *
3204
  * @return mixed|string
3205
  */
3206
- function dokan_get_store_times( $current_day, $times_type, $index = 0 ) {
3207
- $store_info = dokan_get_store_info( dokan_get_current_user_id() );
3208
- $dokan_store_time = isset( $store_info['dokan_store_time'] ) ? $store_info['dokan_store_time'] : '';
3209
- $dokan_store_times = isset( $dokan_store_time[ $current_day ][ $times_type ] ) ? $dokan_store_time[ $current_day ][ $times_type ] : '';
3210
 
3211
  if ( empty( $dokan_store_times ) ) {
3212
  return '';
@@ -3216,7 +3213,7 @@ function dokan_get_store_times( $current_day, $times_type, $index = 0 ) {
3216
  return $dokan_store_times;
3217
  }
3218
 
3219
- if ( isset( $dokan_store_times[ $index ] ) ) {
3220
  return $dokan_store_times[ $index ];
3221
  }
3222
 
@@ -3234,39 +3231,45 @@ function dokan_get_store_times( $current_day, $times_type, $index = 0 ) {
3234
  * @return bool
3235
  */
3236
  function dokan_is_store_open( $user_id ) {
3237
- $store_user = dokan()->vendor->get( $user_id );
3238
- $store_info = $store_user->get_shop_info();
3239
- $open_days = isset( $store_info['dokan_store_time'] ) ? $store_info['dokan_store_time'] : '';
3240
-
3241
- $current_time = dokan_current_datetime();
3242
- $formatted_current_time = dokan_current_datetime()->format( 'g:i a' );
3243
- $today = strtolower( $current_time->format( 'l' ) );
3244
- $store_open = false;
3245
- $status = '';
3246
- $schedule = [];
3247
-
3248
- // Check if isset current day open, close time.
3249
- if ( isset( $open_days[ $today ] ) ) {
3250
- $schedule = $open_days[ $today ];
3251
- $status = isset( $schedule['open'] ) ? $schedule['open'] : $schedule['status'];
3252
- }
3253
-
3254
- // Check if our store is open then check store opening, closing time for throw store open status.
3255
- if ( isset( $status ) && 'open' === $status ) {
3256
- $open_time = ! empty( $schedule['opening_time'] ) ? ( is_array( $schedule['opening_time'] ) ? $schedule['opening_time'][0] : $schedule['opening_time'] ) : '';
3257
- $close_time = ! empty( $schedule['closing_time'] ) ? ( is_array( $schedule['closing_time'] ) ? $schedule['closing_time'][0] : $schedule['closing_time'] ) : '';
3258
-
3259
- if ( empty( $open_time ) || empty( $close_time ) ) {
3260
- $store_open = true;
3261
- }
3262
 
3263
- // Check vendor picked time and current time for show store open.
3264
- if ( $open_time <= $formatted_current_time && $close_time >= $formatted_current_time ) {
3265
- $store_open = true;
3266
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3267
  }
3268
 
3269
- return apply_filters( 'dokan_is_store_open', $store_open, $status, $schedule, $store_user->get_shop_info() );
3270
  }
3271
 
3272
  /**
3185
  return $all_days[ $day ];
3186
  }
3187
 
 
 
 
 
3188
  return apply_filters( 'dokan_get_translated_days', '', $day );
3189
  }
3190
 
3193
  *
3194
  * @since 3.3.7
3195
  *
3196
+ * @param string $day
3197
+ * @param string $return_type eg: opening_time or closing_time
3198
+ * @param int $index
3199
+ * @param int|null $store_id
3200
  *
3201
  * @return mixed|string
3202
  */
3203
+ function dokan_get_store_times( $day, $return_type, $index = null, $store_id = null ) {
3204
+ $store_id = null === $store_id ? dokan_get_current_user_id() : $store_id;
3205
+ $store_info = dokan_get_store_info( $store_id );
3206
+ $dokan_store_times = isset( $store_info['dokan_store_time'][ $day ][ $return_type ] ) ? $store_info['dokan_store_time'][ $day ][ $return_type ] : '';
3207
 
3208
  if ( empty( $dokan_store_times ) ) {
3209
  return '';
3213
  return $dokan_store_times;
3214
  }
3215
 
3216
+ if ( is_numeric( $index ) && isset( $dokan_store_times[ $index ] ) ) {
3217
  return $dokan_store_times[ $index ];
3218
  }
3219
 
3231
  * @return bool
3232
  */
3233
  function dokan_is_store_open( $user_id ) {
3234
+ $store_user = dokan()->vendor->get( $user_id );
3235
+ $store_info = $store_user->get_shop_info();
3236
+ $dokan_store_times = isset( $store_info['dokan_store_time'] ) ? $store_info['dokan_store_time'] : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3237
 
3238
+ $current_time = dokan_current_datetime();
3239
+ $today = strtolower( $current_time->format( 'l' ) );
3240
+ $store_open = false;
3241
+
3242
+ // check if status is closed
3243
+ if ( empty( $dokan_store_times[ $today ] ) || ( isset( $dokan_store_times[ $today ]['status'] ) && 'close' === $dokan_store_times[ $today ]['status'] ) ) {
3244
+ $store_open = false;
3245
+ return apply_filters( 'dokan_is_store_open', $store_open, $today, $dokan_store_times );
3246
+ }
3247
+
3248
+ // Get store opening time.
3249
+ $opening_times = ! empty( $dokan_store_times[ $today ]['opening_time'] ) ? $dokan_store_times[ $today ]['opening_time'] : [];
3250
+ // Get single time.
3251
+ $opening_time = ! empty( $opening_times ) && is_array( $opening_times ) ? $opening_times[0] : $opening_times;
3252
+ // Convert to timestamp.
3253
+ $opening_time = $current_time->modify( $opening_time );
3254
+
3255
+ // Get closing time.
3256
+ $closing_times = ! empty( $dokan_store_times[ $today ]['closing_time'] ) ? $dokan_store_times[ $today ]['closing_time'] : [];
3257
+ // Get single time.
3258
+ $closing_time = ! empty( $closing_times ) && is_array( $closing_times ) ? $closing_times[0] : $closing_times;
3259
+ // Convert to timestamp.
3260
+ $closing_time = $current_time->modify( $closing_time );
3261
+
3262
+ if ( empty( $opening_time ) || empty( $closing_time ) ) {
3263
+ $store_open = false;
3264
+ return apply_filters( 'dokan_is_store_open', $store_open, $today, $dokan_store_times );
3265
+ }
3266
+
3267
+ // Check vendor picked time and current time for show store open.
3268
+ if ( $opening_time <= $current_time && $closing_time >= $current_time ) {
3269
+ $store_open = true;
3270
  }
3271
 
3272
+ return apply_filters( 'dokan_is_store_open', $store_open, $today, $dokan_store_times );
3273
  }
3274
 
3275
  /**
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.3.7\n"
6
  "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
7
- "POT-Creation-Date: 2022-02-03 13:14:27+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -880,7 +880,7 @@ msgstr ""
880
  msgid "Select a page to show your privacy policy"
881
  msgstr ""
882
 
883
- #: includes/Admin/Settings.php:683 includes/functions.php:3595
884
  msgid ""
885
  "Your personal data will be used to support your experience throughout this "
886
  "website, to manage access to your account, and for other purposes described "
@@ -4577,7 +4577,7 @@ msgstr ""
4577
  #: includes/Widgets/StoreCategoryMenu.php:87
4578
  #: includes/Widgets/StoreContactForm.php:126
4579
  #: includes/Widgets/StoreLocation.php:110
4580
- #: includes/Widgets/StoreOpenClose.php:118
4581
  #: includes/Widgets/TopratedProducts.php:76
4582
  msgid "Title:"
4583
  msgstr ""
@@ -4652,7 +4652,7 @@ msgid "Dokan: Store Opening Closing Time Widget"
4652
  msgstr ""
4653
 
4654
  #: includes/Widgets/StoreOpenClose.php:41
4655
- #: includes/Widgets/StoreOpenClose.php:111 includes/template-tags.php:738
4656
  msgid "Store Time"
4657
  msgstr ""
4658
 
@@ -5184,32 +5184,28 @@ msgstr ""
5184
  msgid "Saturday"
5185
  msgstr ""
5186
 
5187
- #: includes/functions.php:3189
5188
- msgid "Off Day"
5189
- msgstr ""
5190
-
5191
- #: includes/functions.php:3575
5192
  msgid "privacy policy"
5193
  msgstr ""
5194
 
5195
- #: includes/functions.php:3620 src/admin/pages/VendorPaymentFields.vue:142
5196
  #: src/admin/pages/VendorPaymentFields.vue:155
5197
  msgid "Flat"
5198
  msgstr ""
5199
 
5200
- #: includes/functions.php:3621 src/admin/pages/VendorPaymentFields.vue:146
5201
  msgid "Percentage"
5202
  msgstr ""
5203
 
5204
- #: includes/functions.php:3640
5205
  msgid "Please Login to Continue"
5206
  msgstr ""
5207
 
5208
- #: includes/functions.php:3823
5209
  msgid "Unable to fetch plugin information from wordpress.org for %s."
5210
  msgstr ""
5211
 
5212
- #: includes/functions.php:3835
5213
  msgid "Unable to install %s from wordpress.org"
5214
  msgstr ""
5215
 
@@ -8004,8 +8000,8 @@ msgstr ""
8004
  msgid "Send Message"
8005
  msgstr ""
8006
 
8007
- #: templates/widgets/store-open-close.php:19
8008
- msgid "<span> %s %s %s </span>"
8009
  msgstr ""
8010
 
8011
  #: templates/widgets/widget-content-product.php:47
2
  # This file is distributed under the GPL2.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Dokan 3.3.8\n"
6
  "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
7
+ "POT-Creation-Date: 2022-02-17 09:16:15+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
880
  msgid "Select a page to show your privacy policy"
881
  msgstr ""
882
 
883
+ #: includes/Admin/Settings.php:683 includes/functions.php:3598
884
  msgid ""
885
  "Your personal data will be used to support your experience throughout this "
886
  "website, to manage access to your account, and for other purposes described "
4577
  #: includes/Widgets/StoreCategoryMenu.php:87
4578
  #: includes/Widgets/StoreContactForm.php:126
4579
  #: includes/Widgets/StoreLocation.php:110
4580
+ #: includes/Widgets/StoreOpenClose.php:119
4581
  #: includes/Widgets/TopratedProducts.php:76
4582
  msgid "Title:"
4583
  msgstr ""
4652
  msgstr ""
4653
 
4654
  #: includes/Widgets/StoreOpenClose.php:41
4655
+ #: includes/Widgets/StoreOpenClose.php:112 includes/template-tags.php:738
4656
  msgid "Store Time"
4657
  msgstr ""
4658
 
5184
  msgid "Saturday"
5185
  msgstr ""
5186
 
5187
+ #: includes/functions.php:3578
 
 
 
 
5188
  msgid "privacy policy"
5189
  msgstr ""
5190
 
5191
+ #: includes/functions.php:3623 src/admin/pages/VendorPaymentFields.vue:142
5192
  #: src/admin/pages/VendorPaymentFields.vue:155
5193
  msgid "Flat"
5194
  msgstr ""
5195
 
5196
+ #: includes/functions.php:3624 src/admin/pages/VendorPaymentFields.vue:146
5197
  msgid "Percentage"
5198
  msgstr ""
5199
 
5200
+ #: includes/functions.php:3643
5201
  msgid "Please Login to Continue"
5202
  msgstr ""
5203
 
5204
+ #: includes/functions.php:3826
5205
  msgid "Unable to fetch plugin information from wordpress.org for %s."
5206
  msgstr ""
5207
 
5208
+ #: includes/functions.php:3838
5209
  msgid "Unable to install %s from wordpress.org"
5210
  msgstr ""
5211
 
8000
  msgid "Send Message"
8001
  msgstr ""
8002
 
8003
+ #: templates/widgets/store-open-close.php:18
8004
+ msgid "Off Day"
8005
  msgstr ""
8006
 
8007
  #: templates/widgets/widget-content-product.php:47
readme.txt CHANGED
@@ -5,9 +5,9 @@ Tags: WooCommerce multivendor marketplace, multi vendor marketplace, multi selle
5
  Requires at least: 4.4
6
  Tested up to: 5.9
7
  WC requires at least: 3.0
8
- WC tested up to: 6.1.1
9
  Requires PHP: 5.6
10
- Stable tag: 3.3.7
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -306,6 +306,10 @@ A. Just install and activate the PRO version without deleting the free plugin. A
306
 
307
  == Changelog ==
308
 
 
 
 
 
309
  = v3.3.7 ( Feb 03, 2022 ) =
310
 
311
  - **feat:** Added Featured, Latest, Best Selling, Top Rated Product sections under single store page
5
  Requires at least: 4.4
6
  Tested up to: 5.9
7
  WC requires at least: 3.0
8
+ WC tested up to: 6.2.0
9
  Requires PHP: 5.6
10
+ Stable tag: 3.3.8
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
306
 
307
  == Changelog ==
308
 
309
+ = v3.3.8 ( Feb 17, 2022 ) =
310
+
311
+ - **fix:** Store open close time widget wasn't working
312
+
313
  = v3.3.7 ( Feb 03, 2022 ) =
314
 
315
  - **feat:** Added Featured, Latest, Best Selling, Top Rated Product sections under single store page
templates/whats-new.php CHANGED
@@ -3,6 +3,18 @@
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.3.7',
8
  'released' => '2022-02-03',
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.3.8',
8
+ 'released' => '2022-02-17',
9
+ 'changes' => [
10
+ 'Fix' => [
11
+ [
12
+ 'title' => 'Store open close time widget wasn\'t working',
13
+ 'description' => '',
14
+ ],
15
+ ],
16
+ ],
17
+ ],
18
  [
19
  'version' => 'Version 3.3.7',
20
  'released' => '2022-02-03',
templates/widgets/store-open-close.php CHANGED
@@ -8,26 +8,76 @@
8
  */
9
  ?>
10
  <div class="dokan-store-open-close">
11
- <?php foreach( $dokan_store_time as $day => $value ) : ?>
12
- <?php
13
- $status = isset( $value['open'] ) ? $value['open'] : $value['status'];
14
- $to = ! empty( dokan_get_translated_days( $status ) ) ? dokan_get_translated_days( $status ) : '-';
15
- $is_open = $status == 'open' ? true : false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ?>
 
17
  <div class="open-close-day <?php echo esc_attr( $day ) . '-time' ?>">
18
- <label for=""><?php echo esc_attr( dokan_get_translated_days( $day ) ); ?></label>:
19
- <?php echo sprintf( __( '<span> %s %s %s </span>', 'dokan-lite' ), $is_open ? esc_attr( ucfirst( $value['opening_time'] ) ) : '' , $to, $is_open ? esc_attr( ucfirst( $value['closing_time'] ) ) : '' ); //// phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  </div>
21
  <?php endforeach; ?>
22
  </div>
 
23
  <style>
24
- .dokan-store-open-close label {
25
- width: 85px;
26
- }
27
- .dokan-store-open-close span {
28
- padding-left: 10px;
29
  }
 
 
 
 
 
 
30
  .dokan-store-open-close .open-close-day {
31
  padding-top: 10px;
32
  }
 
 
 
33
  </style>
8
  */
9
  ?>
10
  <div class="dokan-store-open-close">
11
+ <?php foreach( $dokan_days as $day => $value ) : ?>
12
+ <?php
13
+ if ( ! isset( $dokan_store_time[ $day ] ) || ( isset( $dokan_store_time[ $day ]['status'] ) && 'close' === $dokan_store_time[ $day ]['status'] ) ) {
14
+ echo sprintf(
15
+ '<div class="open-close-day %1$s-time"><div class="working-day">%2$s</div> : <div class="store-times"> %3$s </div></div>',
16
+ esc_attr( $day ),
17
+ esc_html( ucfirst( dokan_get_translated_days( $day ) ) ),
18
+ __( 'Off Day', 'dokan-lite' )
19
+ );
20
+ continue;
21
+ }
22
+
23
+ // Get store opening time.
24
+ $opening_times = ! empty( $dokan_store_time[ $day ]['opening_time'] ) ? $dokan_store_time[ $day ]['opening_time'] : [];
25
+
26
+ // If dokan pro doesn't exists then show single item.
27
+ if ( ! dokan()->is_pro_exists() ) {
28
+ // Get single time.
29
+ $opening_times = ! empty( $opening_times ) && is_array( $opening_times ) ? $opening_times[0] : [];
30
+ }
31
+
32
+ $times_length = ! empty( $opening_times ) ? count( (array) $opening_times ) : 0;
33
+
34
+ // Return if opening time length is zero.
35
+ if ( empty( $times_length ) ) {
36
+ continue;
37
+ }
38
  ?>
39
+
40
  <div class="open-close-day <?php echo esc_attr( $day ) . '-time' ?>">
41
+ <div class="working-day"><?php echo esc_html( ucfirst( dokan_get_translated_days( $day ) ) ); ?></div> :
42
+ <div class="store-times">
43
+ <?php
44
+ // Get formatted store times.
45
+ for ( $index = 0; $index < $times_length; $index++ ) :
46
+ error_log( print_r( $dokan_store_time, 1 ) );
47
+ $opening_timestamps = dokan_current_datetime()->modify( $dokan_store_time[ $day ]['opening_time'][ $index ] )->getTimestamp();
48
+ $closing_timestamps = dokan_current_datetime()->modify( $dokan_store_time[ $day ]['closing_time'][ $index ] )->getTimestamp();
49
+ $formatted_opening_time = dokan_format_date( $opening_timestamps, wc_time_format() );
50
+ $formatted_closing_time = dokan_format_date( $closing_timestamps, wc_time_format() );
51
+
52
+ echo sprintf(
53
+ '<div class="store-time">%1$s <span class="separator">-</span> %2$s</div>',
54
+ esc_html( $formatted_opening_time ),
55
+ esc_html( $formatted_closing_time )
56
+ );
57
+ endfor;
58
+ ?>
59
+ </div>
60
  </div>
61
  <?php endforeach; ?>
62
  </div>
63
+
64
  <style>
65
+ .dokan-store-open-close .open-close-day {
66
+ display: flex;
67
+ }
68
+ .dokan-store-open-close .working-day {
69
+ width: 100px;
70
  }
71
+ .dokan-store-open-close .store-times {
72
+ display: flex;
73
+ flex-direction: column;
74
+ padding-left: 10px;
75
+ white-space: nowrap;
76
+ }
77
  .dokan-store-open-close .open-close-day {
78
  padding-top: 10px;
79
  }
80
+ .dokan-store-open-close .store-time .separator {
81
+ padding: 0 5px;
82
+ }
83
  </style>
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit142b6b06b84b6734fb76d6c1efc7c15f::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit453242ef73f85473c17b8233f473c31a::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -127,6 +127,7 @@ return array(
127
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_2_9_4_OrderPostAuthor' => $baseDir . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_2_9_4_OrderPostAuthor.php',
128
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_3_0_10_ProductAttributesAuthorId' => $baseDir . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_3_0_10_ProductAttributesAuthorId.php',
129
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_3_1_1_RefundTableUpdate' => $baseDir . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_3_1_1_RefundTableUpdate.php',
 
130
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_1_2' => $baseDir . '/includes/Upgrade/Upgrades/V_1_2.php',
131
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_2_1' => $baseDir . '/includes/Upgrade/Upgrades/V_2_1.php',
132
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_2_3' => $baseDir . '/includes/Upgrade/Upgrades/V_2_3.php',
@@ -151,6 +152,7 @@ return array(
151
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_2_12' => $baseDir . '/includes/Upgrade/Upgrades/V_3_2_12.php',
152
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_3_1' => $baseDir . '/includes/Upgrade/Upgrades/V_3_3_1.php',
153
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_3_7' => $baseDir . '/includes/Upgrade/Upgrades/V_3_3_7.php',
 
154
  'WeDevs\\Dokan\\Vendor\\Hooks' => $baseDir . '/includes/Vendor/Hooks.php',
155
  'WeDevs\\Dokan\\Vendor\\Manager' => $baseDir . '/includes/Vendor/Manager.php',
156
  'WeDevs\\Dokan\\Vendor\\SetupWizard' => $baseDir . '/includes/Vendor/SetupWizard.php',
127
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_2_9_4_OrderPostAuthor' => $baseDir . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_2_9_4_OrderPostAuthor.php',
128
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_3_0_10_ProductAttributesAuthorId' => $baseDir . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_3_0_10_ProductAttributesAuthorId.php',
129
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_3_1_1_RefundTableUpdate' => $baseDir . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_3_1_1_RefundTableUpdate.php',
130
+ 'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_3_3_8_VendorStoreTimes' => $baseDir . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_3_3_8_VendorStoreTimes.php',
131
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_1_2' => $baseDir . '/includes/Upgrade/Upgrades/V_1_2.php',
132
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_2_1' => $baseDir . '/includes/Upgrade/Upgrades/V_2_1.php',
133
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_2_3' => $baseDir . '/includes/Upgrade/Upgrades/V_2_3.php',
152
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_2_12' => $baseDir . '/includes/Upgrade/Upgrades/V_3_2_12.php',
153
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_3_1' => $baseDir . '/includes/Upgrade/Upgrades/V_3_3_1.php',
154
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_3_7' => $baseDir . '/includes/Upgrade/Upgrades/V_3_3_7.php',
155
+ 'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_3_8' => $baseDir . '/includes/Upgrade/Upgrades/V_3_3_8.php',
156
  'WeDevs\\Dokan\\Vendor\\Hooks' => $baseDir . '/includes/Vendor/Hooks.php',
157
  'WeDevs\\Dokan\\Vendor\\Manager' => $baseDir . '/includes/Vendor/Manager.php',
158
  'WeDevs\\Dokan\\Vendor\\SetupWizard' => $baseDir . '/includes/Vendor/SetupWizard.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit142b6b06b84b6734fb76d6c1efc7c15f
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit142b6b06b84b6734fb76d6c1efc7c15f
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit142b6b06b84b6734fb76d6c1efc7c15f', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit142b6b06b84b6734fb76d6c1efc7c15f', '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\ComposerStaticInit142b6b06b84b6734fb76d6c1efc7c15f::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
@@ -53,19 +53,19 @@ class ComposerAutoloaderInit142b6b06b84b6734fb76d6c1efc7c15f
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
- $includeFiles = Composer\Autoload\ComposerStaticInit142b6b06b84b6734fb76d6c1efc7c15f::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
- composerRequire142b6b06b84b6734fb76d6c1efc7c15f($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
- function composerRequire142b6b06b84b6734fb76d6c1efc7c15f($fileIdentifier, $file)
69
  {
70
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
71
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit453242ef73f85473c17b8233f473c31a
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInit453242ef73f85473c17b8233f473c31a', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit453242ef73f85473c17b8233f473c31a', '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\ComposerStaticInit453242ef73f85473c17b8233f473c31a::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\ComposerStaticInit453242ef73f85473c17b8233f473c31a::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
+ composerRequire453242ef73f85473c17b8233f473c31a($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
+ function composerRequire453242ef73f85473c17b8233f473c31a($fileIdentifier, $file)
69
  {
70
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
71
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit142b6b06b84b6734fb76d6c1efc7c15f
8
  {
9
  public static $files = array (
10
  'b45b351e6b6f7487d819961fef2fda77' => __DIR__ . '/..' . '/jakeasmith/http_build_url/src/http_build_url.php',
@@ -154,6 +154,7 @@ class ComposerStaticInit142b6b06b84b6734fb76d6c1efc7c15f
154
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_2_9_4_OrderPostAuthor' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_2_9_4_OrderPostAuthor.php',
155
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_3_0_10_ProductAttributesAuthorId' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_3_0_10_ProductAttributesAuthorId.php',
156
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_3_1_1_RefundTableUpdate' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_3_1_1_RefundTableUpdate.php',
 
157
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_1_2' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_1_2.php',
158
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_2_1' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_2_1.php',
159
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_2_3' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_2_3.php',
@@ -178,6 +179,7 @@ class ComposerStaticInit142b6b06b84b6734fb76d6c1efc7c15f
178
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_2_12' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_3_2_12.php',
179
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_3_1' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_3_3_1.php',
180
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_3_7' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_3_3_7.php',
 
181
  'WeDevs\\Dokan\\Vendor\\Hooks' => __DIR__ . '/../..' . '/includes/Vendor/Hooks.php',
182
  'WeDevs\\Dokan\\Vendor\\Manager' => __DIR__ . '/../..' . '/includes/Vendor/Manager.php',
183
  'WeDevs\\Dokan\\Vendor\\SetupWizard' => __DIR__ . '/../..' . '/includes/Vendor/SetupWizard.php',
@@ -209,9 +211,9 @@ class ComposerStaticInit142b6b06b84b6734fb76d6c1efc7c15f
209
  public static function getInitializer(ClassLoader $loader)
210
  {
211
  return \Closure::bind(function () use ($loader) {
212
- $loader->prefixLengthsPsr4 = ComposerStaticInit142b6b06b84b6734fb76d6c1efc7c15f::$prefixLengthsPsr4;
213
- $loader->prefixDirsPsr4 = ComposerStaticInit142b6b06b84b6734fb76d6c1efc7c15f::$prefixDirsPsr4;
214
- $loader->classMap = ComposerStaticInit142b6b06b84b6734fb76d6c1efc7c15f::$classMap;
215
 
216
  }, null, ClassLoader::class);
217
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit453242ef73f85473c17b8233f473c31a
8
  {
9
  public static $files = array (
10
  'b45b351e6b6f7487d819961fef2fda77' => __DIR__ . '/..' . '/jakeasmith/http_build_url/src/http_build_url.php',
154
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_2_9_4_OrderPostAuthor' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_2_9_4_OrderPostAuthor.php',
155
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_3_0_10_ProductAttributesAuthorId' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_3_0_10_ProductAttributesAuthorId.php',
156
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_3_1_1_RefundTableUpdate' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_3_1_1_RefundTableUpdate.php',
157
+ 'WeDevs\\Dokan\\Upgrade\\Upgrades\\BackgroundProcesses\\V_3_3_8_VendorStoreTimes' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/BackgroundProcesses/V_3_3_8_VendorStoreTimes.php',
158
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_1_2' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_1_2.php',
159
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_2_1' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_2_1.php',
160
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_2_3' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_2_3.php',
179
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_2_12' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_3_2_12.php',
180
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_3_1' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_3_3_1.php',
181
  'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_3_7' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_3_3_7.php',
182
+ 'WeDevs\\Dokan\\Upgrade\\Upgrades\\V_3_3_8' => __DIR__ . '/../..' . '/includes/Upgrade/Upgrades/V_3_3_8.php',
183
  'WeDevs\\Dokan\\Vendor\\Hooks' => __DIR__ . '/../..' . '/includes/Vendor/Hooks.php',
184
  'WeDevs\\Dokan\\Vendor\\Manager' => __DIR__ . '/../..' . '/includes/Vendor/Manager.php',
185
  'WeDevs\\Dokan\\Vendor\\SetupWizard' => __DIR__ . '/../..' . '/includes/Vendor/SetupWizard.php',
211
  public static function getInitializer(ClassLoader $loader)
212
  {
213
  return \Closure::bind(function () use ($loader) {
214
+ $loader->prefixLengthsPsr4 = ComposerStaticInit453242ef73f85473c17b8233f473c31a::$prefixLengthsPsr4;
215
+ $loader->prefixDirsPsr4 = ComposerStaticInit453242ef73f85473c17b8233f473c31a::$prefixDirsPsr4;
216
+ $loader->classMap = ComposerStaticInit453242ef73f85473c17b8233f473c31a::$classMap;
217
 
218
  }, null, ClassLoader::class);
219
  }