Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Aswell as a temporary fix –> If you want go a step further and change the week-names into your wordpress language you have to edit two files.

    In plugins/woocommerce-local-pickup-time-select/public/class-local-pickup-time.php change line 289 through 299.

    Old

    $today_name = strtolower( date( 'l' ) );
    $today_date = date( 'm/d/Y' );
    
    // Create an empty array for our dates
    $pickup_options = array();
    
    // Loop through all days ahead and add the pickup time options to the array
    for ( $i = 0; $i < 7; $i++ ) {
    
    // Get the date of current iteration
    $current_day_name = date( 'l', strtotime( "+$i days" ) );

    New

    $today_name = strtolower( date_i18n( 'l' ) );
    $today_date = date( 'm/d/Y' );
    
    // Create an empty array for our dates
    $pickup_options = array();
    
    // Loop through all days ahead and add the pickup time options to the array
    for ( $i = 0; $i < 7; $i++ ) {
    
    // Get the date of current iteration
    $current_day_name = date_i18n( 'l', strtotime( "+$i days" ) );

    And in plugins/woocommerce-local-pickup-time-select/admin/class-local-pickup-time-admin.php use find and replace to change all english weekday-names into your desired language. This has to be done very precise, so make sure you spell the names correctly.

    Hope this helps

    As a temporary fix: on line 330 and 331 change g into G and h into H in plugins/woocommerce-local-pickup-time-select/public/class-local-pickup-time.php. Your hours will now be displayed in the 24-hour-format.

    Old

    $option_key = $current_day_name . date( "_h_i", $tNow );
    $option_value = $day_name . ' ' . date( "g:i", $tNow );

    New

    $option_key = $current_day_name . date( "_H_i", $tNow );
    $option_value = $day_name . ' ' . date( "G:i", $tNow );

Viewing 2 replies - 1 through 2 (of 2 total)