admin->get_data(); $location_id = get_option('location_defualt', min($data)->id); $location = wc_local_pickup()->admin->get_data_byid($location_id); $country_code = isset($location) ? $location->store_country : get_option('woocommerce_default_country'); $split_country = explode( ':', $country_code ); $store_country = isset($split_country[0]) ? $split_country[0] : ''; $store_state = isset($split_country[1]) ? $split_country[1] : ''; $store_days = isset($location) ? unserialize($location->store_days) : array(); $all_days = array( 'sunday' => esc_html__( 'Sunday', 'advanced-local-pickup-for-woocommerce' ), 'monday' => esc_html__( 'Monday', 'advanced-local-pickup-for-woocommerce' ), 'tuesday' => esc_html__( 'Tuesday', 'advanced-local-pickup-for-woocommerce' ), 'wednesday' => esc_html__( 'Wednesday', 'advanced-local-pickup-for-woocommerce' ), 'thursday' => esc_html__( 'Thursday', 'advanced-local-pickup-for-woocommerce' ), 'friday' => esc_html__( 'Friday', 'advanced-local-pickup-for-woocommerce' ), 'saturday' => esc_html__( 'Saturday', 'advanced-local-pickup-for-woocommerce' ), ); $w_day = array_slice($all_days, get_option('start_of_week')); foreach ($all_days as $key=>$val) { $w_day[$key] = $val; } foreach ($store_days as $key => $val) { if ($w_day[$key]) { $w_day[$key] = $val; } } $wclp_default_time_format = isset($location->store_time_format) ? $location->store_time_format : '24'; if ('12' == $wclp_default_time_format) { foreach ($w_day as $key=>$val) { if (isset($val['wclp_store_hour'])) { $last_digit = explode(':', $val['wclp_store_hour']); if ('00' == end($last_digit)) { $val['wclp_store_hour'] = gmdate('ga', strtotime($val['wclp_store_hour'])); } else { $val['wclp_store_hour'] = gmdate('g:ia', strtotime($val['wclp_store_hour'])); } } if (isset($val['wclp_store_hour_end'])) { $last_digit = explode(':', $val['wclp_store_hour_end']); if ('00' == end($last_digit)) { $val['wclp_store_hour_end'] = gmdate('ga', strtotime($val['wclp_store_hour_end'])); } else { $val['wclp_store_hour_end'] = gmdate('g:ia', strtotime($val['wclp_store_hour_end'])); } } $w_day[$key] = $val; } } if (!empty($w_day)) { $n = 0; $new_array = []; $previousValue = []; foreach ($w_day as $day=>$value) { if (isset($value['checked']) && 1 == $value['checked']) { if ($value != $previousValue) { $n++; } $new_array[$n][$day] = $value; $previousValue = $value; } else { $n++; $new_array[$n][$day] = ''; $previousValue = ''; } } } $alp = new WC_Local_Pickup_admin(); $Wclp_Pickup_Instruction_Customizer = new Wclp_Pickup_Instruction_Customizer(); $hide_instruction_heading = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'hide_instruction_heading', ''); $hide_table_header = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'hide_table_header', ''); $location_box_heading = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'location_box_heading', $Wclp_Pickup_Instruction_Customizer->defaults['location_box_heading']); $header_address_text = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'header_address_text', $Wclp_Pickup_Instruction_Customizer->defaults['header_address_text']); $header_business_text = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'header_business_text', $Wclp_Pickup_Instruction_Customizer->defaults['header_business_text']); $header_background_color = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'header_background_color', $Wclp_Pickup_Instruction_Customizer->defaults['header_background_color']); $header_font_size = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'header_font_size', $Wclp_Pickup_Instruction_Customizer->defaults['header_font_size']); $location_box_font_size = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'location_box_font_size', $Wclp_Pickup_Instruction_Customizer->defaults['location_box_font_size']); $location_box_content_line_height = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'location_box_content_line_height', $Wclp_Pickup_Instruction_Customizer->defaults['location_box_content_line_height']); $location_box_border_size = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'location_box_border_size', $Wclp_Pickup_Instruction_Customizer->defaults['location_box_border_size']); $location_box_font_color = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'location_box_font_color', $Wclp_Pickup_Instruction_Customizer->defaults['location_box_font_color']); $header_font_color = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'header_font_color', $Wclp_Pickup_Instruction_Customizer->defaults['header_font_color']); $location_box_border_color = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'location_box_border_color', $Wclp_Pickup_Instruction_Customizer->defaults['location_box_border_color']); $location_box_background_color = $alp->get_option_value_from_array('pickup_instruction_display_settings', 'location_box_background_color', $Wclp_Pickup_Instruction_Customizer->defaults['location_box_background_color']); ?>
store_name)) { echo esc_html($location->store_name); echo ', '; } ?>
store_address)) { echo esc_html($location->store_address); if (!empty($location->store_address_2)) { echo ', '; } } if (!empty($location->store_address_2)) { echo esc_html($location->store_address_2); echo ', '; } ?>
store_city)) { echo esc_html($location->store_city); if ('' != $store_state) { echo ', '; } } if ('' != $store_state) { echo esc_html(WC()->countries->get_states( $store_country )[$store_state]); } if ($store_country) { echo ', '; } if ($store_country) { echo esc_html(WC()->countries->countries[$store_country]); if (!empty($location->store_postcode)) { echo ', '; } } if (!empty($location->store_postcode)) { echo esc_html($location->store_postcode); } ?>
store_phone)) { ?>store_phone); ?>
store_instruction)) { ?>store_instruction); ?>
: ' . esc_html(reset($data)['wclp_store_hour']) . ' - ' . esc_html(reset($data)['wclp_store_hour_end']); do_action('wclp_get_more_work_hours_contents', $data); echo ''; ?>
- ' . esc_html(ucfirst($array_key_last), 'advanced-local-pickup-for-woocommerce') . ' : ' . esc_html(reset($data)['wclp_store_hour']) . ' - ' . esc_html(reset($data)['wclp_store_hour_end']); do_action('wclp_get_more_work_hours_contents', $data); echo ''; ?>
2) { if (isset(reset($data)['wclp_store_hour']) && '' != reset($data)['wclp_store_hour'] && isset(reset($data)['wclp_store_hour_end']) && '' != reset($data)['wclp_store_hour_end']) { reset($data); $array_key_first = key($data); end($data); $array_key_last = key($data); ?>: ' . esc_html(reset($data)['wclp_store_hour']) . ' - ' . esc_html(reset($data)['wclp_store_hour_end']); do_action('wclp_get_more_work_hours_contents', $data); echo ''; ?>
store_holiday_message)) { ?>store_holiday_message); ?>