TIME
-
the opening and closing time of the store is 4 hours in advance, if I put in UTC the store orders are 4 hours more and the stores are wrong opening and closing, but if I put my time in UTC-4 a woocomerce time is certain, but dokan stores are 4 hours early, I can’t solve this
-
I’ve tried several changes in php.ini, htaccess, wp, -settings, general wordpress configuration, store-form file and I can’t solve it, it seems that by day it works but at night stores close at 20:00
-
This reply was modified 5 years, 7 months ago by
Fabricio10.
</select> </label> <label for="opening-time" class="time" style="visibility: <?php echo isset( $status ) && $status == 'open' ? 'visible' : 'hidden' ?>; display:block" > <input type="text" class="dokan-form-control" name="<?php echo esc_attr( strtolower( $day ) ); ?>_opening_time" id="<?php echo esc_attr( $day ) ?>-opening-time" placeholder="<?php echo esc_attr( date_i18n( get_option( 'time_format' ), current_time( 'timestamp' ) ) ); ?>" value="<?php echo isset( $all_times[$day]['opening_time'] ) ? esc_attr( $all_times[$day]['opening_time'] ) : '' ?>" > </label> <label for="closing-time" class="time" style="visibility: <?php echo isset( $status ) && $status == 'open' ? 'visible' : 'hidden' ?>;display:block" > <input type="text" class="dokan-form-control" name="<?php echo esc_attr( $day ) ?>_closing_time" id="<?php echo esc_attr( $day ) ?>-closing-time" placeholder="<?php echo esc_attr( date_i18n( get_option( 'time_format' ), current_time( 'timestamp' ) ) ); ?>" value="<?php echo isset( $all_times[$day]['closing_time'] ) ? esc_attr( $all_times[$day]['closing_time'] ) : '' ?>"> </label>after midnight it seems to work, the store opens and closes. For example, opening 00.30 and closing 00:50 works. but after 8 pm the schedule fails. It seems that the day ends at 20:00 and the next only starts after 00:00
in wordpress admin settings my date and time are at:
Time zone: America / Campo_Grande
Custom Date: d / m / Y \ – \ H: i \ h \
Time: H: i
in (Wp-setting) is: date_default_timezone_set (‘UTC’);
in (user.ini) is date.timezone = “(‘America / Campo_Grande’)”
in woocoomerce status: the message says> The default time zone is UTC:
(my servudor is a turbo plan in the shared hosting of https://www.hostgator.com.br/)
Now at 00:54 everything works normal, but it seems that after 20:00 the stores close and it is not possible to program, as if the day is already over.
My dokna is Version 3.0.3 and I cannot update it because I made many customizations in the layout, but the code and behavior has not been changed.
I’ve tried to disable some puglins but nothing solves, everything goes back to normal after 00.00
Hello @fabriciobarros10 ,
I have tested thoroughly. Dokan uses the WordPress function
current_time( 'timestamp' );to compare the opening and closing hours of the store. It will convert your saved opening and closing times according to your time zone settings from wp-admin and compare it with the current time. You do not need to modify any other settings from your server to make it work.You can see the function definition here: dokan-lite/includes/functions.php – dokan_is_store_open().
I will recommend to test this with a new installation with the latest Dokan Lite. Just complete the regular settings, I believe you will face no issues.
Let me know if you still get problems with the new installation.
Thank you π
@rur165
I can’t update because it has a lot of customizations. The time seems to be right but it only works until 20:00. it seems that the time the pluglin pulls right but the day does not. The Day ends at 20:00 and returns to normal after 00:00.
If I set the store to open 00:00 and close 00:10 it works perfectly. After 20:00 it doesn’t work anymore, because in the universal time it is already another day.it seems that the Day is pulled by universal time
Hello @fabriciobarros10 ,
Okay, I will test it today according to the UTC 20:00 time and let you know if the problem is there.
Thanks for your patience.
Hello @fabriciobarros10 ,
I and my colleague tested from two different timezones and we did not face the issue according to the UTC timezone. The store was open even after UTC 20:00.
You may look closely at this function – https://developer.ww.wp.xz.cn/reference/functions/current_time/ that is used to check the time in Dokan. I have also included the file location in the previous reply.
If none of this works, you can contact our support for further investigation but it will be recommended to use the updated version. You can create a test site as well with the updated Dokan Lite to check the problem.
Thank you π
@rur165
Opening and closing works until 00:00 if I leave the hour fill empty. If I schedule to open at 18:00 and close at 23:00 the system does not obey and closes at stores at 8:00 pm. four hours less.Time zone: America / Campo_Grande
Custom Date: d / m / Y \ β \ H: i \ h \
Time: H:i
Wp-seting
// WordPress calculates offsets from UTC.
date_default_timezone_set(‘UTC’);if I leave it blank, the store won’t open.
if I put the w-p setting in america / campo grande and change the time zone in the admin panel to UTC, the time will work. but orders register 4 hours more
if on how can I leave the configuration panel in UTC and the Wp-setting file in america / campogrande. scheduling works
however, you would need to manually change a file on the woocomerce so that orders can be registered in america-campograde or UTC-4. So it would work, because now it takes time from the administrative panel and orders are 4 hours more
Hello @fabriciobarros10 ,
I will test again according to your Time Zone settings. Please allow me some time to get back to you.
Thank you π
?
Hello @fabriciobarros10 ,
My test results do not show the issue. Just to be sure let me clear it up.
You have the WordPress settings like this – https://prnt.sc/v7mmdp and the store open hours are set like this – https://prnt.sc/v7mn40. Is that right?
Did you try with a test site with the latest Dokan version to be sure if the problem is on the older version?
Thank you.
after 00:00 the schedule works normally.
The error occurs from 20:00 to 00:00.at 20: 00h the universal time is already 00:00 while the place is still eight hours. So in the universal time it is already another day.
It seems that the plug pulls the local time, but pulls the universal day.
-
This reply was modified 5 years, 7 months ago by
The topic ‘TIME’ is closed to new replies.
