Changeset 3396942
- Timestamp:
- 11/17/2025 06:54:42 AM (5 months ago)
- Location:
- multiloca-lite-multi-location-inventory
- Files:
-
- 24 edited
- 1 copied
-
tags/1.1.2 (copied) (copied from multiloca-lite-multi-location-inventory/trunk)
-
tags/1.1.2/admin/class-multiloca-lite-admin.php (modified) (5 diffs)
-
tags/1.1.2/admin/css/multiloca-lite-admin.css (modified) (1 diff)
-
tags/1.1.2/includes/class-multiloca-lite-activator.php (modified) (1 diff)
-
tags/1.1.2/includes/class-multiloca-lite-taxonomy.php (modified) (6 diffs)
-
tags/1.1.2/multiloca-lite-multi-location-inventory.php (modified) (1 diff)
-
tags/1.1.2/public/controller/shop/views/multiloca-card-view.php (modified) (2 diffs)
-
tags/1.1.2/public/controller/shop/views/multiloca-expanded-view.php (modified) (2 diffs)
-
tags/1.1.2/public/controller/shop/views/multiloca-list-view.php (modified) (2 diffs)
-
tags/1.1.2/public/controller/shop/views/multiloca-simple-text-view.php (modified) (2 diffs)
-
tags/1.1.2/public/controller/shop/views/multiloca-table-view.php (modified) (2 diffs)
-
tags/1.1.2/public/css/multiloca-lite-public.css (modified) (2 diffs)
-
tags/1.1.2/uninstall.php (modified) (2 diffs)
-
trunk/admin/class-multiloca-lite-admin.php (modified) (5 diffs)
-
trunk/admin/css/multiloca-lite-admin.css (modified) (1 diff)
-
trunk/includes/class-multiloca-lite-activator.php (modified) (1 diff)
-
trunk/includes/class-multiloca-lite-taxonomy.php (modified) (6 diffs)
-
trunk/multiloca-lite-multi-location-inventory.php (modified) (1 diff)
-
trunk/public/controller/shop/views/multiloca-card-view.php (modified) (2 diffs)
-
trunk/public/controller/shop/views/multiloca-expanded-view.php (modified) (2 diffs)
-
trunk/public/controller/shop/views/multiloca-list-view.php (modified) (2 diffs)
-
trunk/public/controller/shop/views/multiloca-simple-text-view.php (modified) (2 diffs)
-
trunk/public/controller/shop/views/multiloca-table-view.php (modified) (2 diffs)
-
trunk/public/css/multiloca-lite-public.css (modified) (2 diffs)
-
trunk/uninstall.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
multiloca-lite-multi-location-inventory/tags/1.1.2/admin/class-multiloca-lite-admin.php
r3377945 r3396942 168 168 // Register location display settings 169 169 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_selection', array('sanitize_callback' => 'sanitize_text_field')); 170 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_shop_filter', array('sanitize_callback' => 'sanitize_text_field')); 170 171 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_address', array('sanitize_callback' => 'sanitize_text_field')); 171 172 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_city', array('sanitize_callback' => 'sanitize_text_field')); … … 175 176 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_email', array('sanitize_callback' => 'sanitize_text_field')); 176 177 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_phone', array('sanitize_callback' => 'sanitize_text_field')); 178 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_business_hours', array('sanitize_callback' => 'sanitize_text_field')); 177 179 register_setting('multiloca_lite_location_settings', 'wcmlim_listing_preset_location', array('sanitize_callback' => 'sanitize_text_field')); 178 180 … … 289 291 290 292 add_settings_field( 293 'wcmlim_enable_shop_filter', 294 __('Enable Location Filtering On Shop Page', 'multiloca-lite-multi-location-inventory'), 295 array($this, 'render_checkbox_field'), 296 'multiloca-lite-location-settings', 297 'multiloca_lite_location_section', 298 array( 299 'id' => 'wcmlim_enable_shop_filter', 300 'tooltip' => __('How it works: 1) Enable this setting 2) Go to Appearance → Widgets 3) Add "Multiloca Location Filter" widget to your shop sidebar 4) Customers can then filter products by selecting multiple locations using checkboxes. The widget only appears on shop and product archive pages.', 'multiloca-lite-multi-location-inventory'), 301 'description' => __('When enabled, a location filter widget will be available to add to sidebars on shop and archive pages. Customers can filter products by selecting one or multiple locations.', 'multiloca-lite-multi-location-inventory') 302 ) 303 ); 304 305 add_settings_field( 291 306 'wcmlim_listing_preset_location', 292 307 __('Order Locations By', 'multiloca-lite-multi-location-inventory'), … … 388 403 ) 389 404 ); 405 406 add_settings_field( 407 'wcmlim_enable_location_business_hours', 408 __('Show Business Hours', 'multiloca-lite-multi-location-inventory'), 409 array($this, 'render_checkbox_field'), 410 'multiloca-lite-location-settings', 411 'multiloca_lite_location_section', 412 array( 413 'id' => 'wcmlim_enable_location_business_hours', 414 'description' => __('Display business hours on frontend location views', 'multiloca-lite-multi-location-inventory') 415 ) 416 ); 390 417 } 391 418 … … 397 424 $value = get_option($id, ''); 398 425 echo '<input type="checkbox" id="' . esc_attr($id) . '" name="' . esc_attr($id) . '" value="on" ' . checked($value, 'on', false) . '>'; 426 427 // Add tooltip if provided 428 if (!empty($args['tooltip'])) { 429 echo ' <span class="dashicons dashicons-editor-help multiloca-tooltip" title="' . esc_attr($args['tooltip']) . '" style="cursor: help; color: #666; font-size: 18px; vertical-align: middle;"></span>'; 430 } 431 399 432 if (!empty($args['description'])) { 400 433 echo '<p class="description">' . esc_html($args['description']) . '</p>'; -
multiloca-lite-multi-location-inventory/tags/1.1.2/admin/css/multiloca-lite-admin.css
r3374381 r3396942 10 10 .form-field textarea { 11 11 width: 95%; 12 } 13 14 /* Tooltip styling */ 15 .multiloca-tooltip { 16 position: relative; 17 display: inline-block; 18 } 19 20 .multiloca-tooltip:hover::after { 21 content: attr(title); 22 position: absolute; 23 left: 50%; 24 bottom: 125%; 25 transform: translateX(-50%); 26 background-color: #000; 27 color: #fff; 28 padding: 8px 12px; 29 border-radius: 4px; 30 white-space: normal; 31 width: 300px; 32 font-size: 13px; 33 line-height: 1.5; 34 z-index: 1000; 35 box-shadow: 0 2px 8px rgba(0,0,0,0.2); 36 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; 37 font-weight: normal; 38 } 39 40 .multiloca-tooltip:hover::before { 41 content: ''; 42 position: absolute; 43 left: 50%; 44 bottom: 115%; 45 transform: translateX(-50%); 46 border: 6px solid transparent; 47 border-top-color: #000; 48 z-index: 1001; 49 } 50 51 /* Business Hours Interface Styling */ 52 .wcmlim-business-hours-container { 53 max-width: 700px; 54 border: 1px solid #ddd; 55 border-radius: 4px; 56 overflow: hidden; 57 } 58 59 .wcmlim-hours-header { 60 display: flex; 61 align-items: center; 62 background-color: #f5f5f5; 63 padding: 12px 15px; 64 border-bottom: 2px solid #ddd; 65 font-weight: 600; 66 color: #333; 67 } 68 69 .wcmlim-day-row { 70 display: flex; 71 align-items: center; 72 padding: 10px 15px; 73 border-bottom: 1px solid #e5e5e5; 74 transition: background-color 0.2s; 75 } 76 77 .wcmlim-day-row:hover { 78 background-color: #f9f9f9; 79 } 80 81 .wcmlim-day-row:last-child { 82 border-bottom: none; 83 } 84 85 .wcmlim-col-day { 86 flex: 0 0 150px; 87 } 88 89 .wcmlim-col-opens, 90 .wcmlim-col-closes { 91 flex: 0 0 150px; 92 padding: 0 10px; 93 } 94 95 .wcmlim-day-checkbox { 96 display: flex; 97 align-items: center; 98 cursor: pointer; 99 margin: 0; 100 } 101 102 .wcmlim-day-checkbox input[type="checkbox"] { 103 margin: 0 10px 0 0; 104 cursor: pointer; 105 } 106 107 .wcmlim-day-label { 108 font-weight: 500; 109 color: #333; 110 } 111 112 .wcmlim-col-opens input[type="time"], 113 .wcmlim-col-closes input[type="time"] { 114 width: 120px; 115 padding: 6px 8px; 116 border: 1px solid #ddd; 117 border-radius: 4px; 118 font-size: 14px; 119 } 120 121 .wcmlim-col-opens input[type="time"]:focus, 122 .wcmlim-col-closes input[type="time"]:focus { 123 border-color: #2271b1; 124 outline: none; 125 box-shadow: 0 0 0 1px #2271b1; 12 126 } 13 127 -
multiloca-lite-multi-location-inventory/tags/1.1.2/includes/class-multiloca-lite-activator.php
r3377945 r3396942 40 40 'wcmlim_txt_in_btn_outofstock' => __('Out of Stock', 'multiloca-lite-multi-location-inventory'), 41 41 'wcmlim_listing_preset_location' => 'alphabetical', 42 'wcmlim_enable_location_selection' => 'on' 42 'wcmlim_enable_location_selection' => 'on', 43 'wcmlim_enable_shop_filter' => '' 43 44 ); 44 45 -
multiloca-lite-multi-location-inventory/tags/1.1.2/includes/class-multiloca-lite-taxonomy.php
r3336945 r3396942 79 79 register_term_meta('locations-lite', 'wcmlim_email', ['show_in_rest' => true]); 80 80 register_term_meta('locations-lite', 'wcmlim_phone', ['show_in_rest' => true]); 81 register_term_meta('locations-lite', 'wcmlim_business_hours', ['show_in_rest' => true]); 81 82 register_term_meta('locations-lite', 'wcmlim_location_priority', ['show_in_rest' => true]); 82 83 register_term_meta('locations-lite', 'wcmlim_start_time', ['show_in_rest' => true]); … … 139 140 </div> 140 141 <div class="form-field"> 142 <label><?php esc_html_e('Business Hours', 'multiloca-lite-multi-location-inventory'); ?></label> 143 <div class="wcmlim-business-hours-container"> 144 <div class="wcmlim-hours-header"> 145 <div class="wcmlim-col-day"><?php esc_html_e('Day', 'multiloca-lite-multi-location-inventory'); ?></div> 146 <div class="wcmlim-col-opens"><?php esc_html_e('Opens At', 'multiloca-lite-multi-location-inventory'); ?></div> 147 <div class="wcmlim-col-closes"><?php esc_html_e('Closes At', 'multiloca-lite-multi-location-inventory'); ?></div> 148 </div> 149 <?php 150 $days = array( 151 'monday' => __('Monday', 'multiloca-lite-multi-location-inventory'), 152 'tuesday' => __('Tuesday', 'multiloca-lite-multi-location-inventory'), 153 'wednesday' => __('Wednesday', 'multiloca-lite-multi-location-inventory'), 154 'thursday' => __('Thursday', 'multiloca-lite-multi-location-inventory'), 155 'friday' => __('Friday', 'multiloca-lite-multi-location-inventory'), 156 'saturday' => __('Saturday', 'multiloca-lite-multi-location-inventory'), 157 'sunday' => __('Sunday', 'multiloca-lite-multi-location-inventory') 158 ); 159 160 foreach ($days as $day_key => $day_label) { 161 ?> 162 <div class="wcmlim-day-row"> 163 <div class="wcmlim-col-day"> 164 <label class="wcmlim-day-checkbox"> 165 <input type="checkbox" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][enabled]" value="1" /> 166 <span class="wcmlim-day-label"><?php echo esc_html($day_label); ?></span> 167 </label> 168 </div> 169 <div class="wcmlim-col-opens"> 170 <input type="time" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][start]" placeholder="09:00" /> 171 </div> 172 <div class="wcmlim-col-closes"> 173 <input type="time" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][end]" placeholder="17:00" /> 174 </div> 175 </div> 176 <?php 177 } 178 ?> 179 </div> 180 <p class="description"><?php esc_html_e('Check the days this location is open and set the hours', 'multiloca-lite-multi-location-inventory'); ?></p> 181 </div> 182 <div class="form-field"> 141 183 <label for="wcmlim_location_priority"><?php esc_html_e('Display Order', 'multiloca-lite-multi-location-inventory'); ?></label> 142 184 <input type="number" name="wcmlim_location_priority" id="wcmlim_location_priority" value="0" /> … … 159 201 $email = get_term_meta($term->term_id, 'wcmlim_email', true); 160 202 $phone = get_term_meta($term->term_id, 'wcmlim_phone', true); 203 $business_hours_json = get_term_meta($term->term_id, 'wcmlim_business_hours', true); 204 $business_hours = !empty($business_hours_json) ? json_decode($business_hours_json, true) : array(); 161 205 $priority = get_term_meta($term->term_id, 'wcmlim_location_priority', true); 162 206 if (empty($priority)) { … … 225 269 <input type="text" name="wcmlim_phone" id="wcmlim_phone" value="<?php echo esc_attr($phone); ?>" /> 226 270 <p class="description"><?php esc_html_e('Enter phone for this location', 'multiloca-lite-multi-location-inventory'); ?></p> 271 </td> 272 </tr> 273 <tr class="form-field"> 274 <th scope="row" valign="top"> 275 <label><?php esc_html_e('Business Hours', 'multiloca-lite-multi-location-inventory'); ?></label> 276 </th> 277 <td> 278 <div class="wcmlim-business-hours-container"> 279 <div class="wcmlim-hours-header"> 280 <div class="wcmlim-col-day"><?php esc_html_e('Day', 'multiloca-lite-multi-location-inventory'); ?></div> 281 <div class="wcmlim-col-opens"><?php esc_html_e('Opens At', 'multiloca-lite-multi-location-inventory'); ?></div> 282 <div class="wcmlim-col-closes"><?php esc_html_e('Closes At', 'multiloca-lite-multi-location-inventory'); ?></div> 283 </div> 284 <?php 285 $days = array( 286 'monday' => __('Monday', 'multiloca-lite-multi-location-inventory'), 287 'tuesday' => __('Tuesday', 'multiloca-lite-multi-location-inventory'), 288 'wednesday' => __('Wednesday', 'multiloca-lite-multi-location-inventory'), 289 'thursday' => __('Thursday', 'multiloca-lite-multi-location-inventory'), 290 'friday' => __('Friday', 'multiloca-lite-multi-location-inventory'), 291 'saturday' => __('Saturday', 'multiloca-lite-multi-location-inventory'), 292 'sunday' => __('Sunday', 'multiloca-lite-multi-location-inventory') 293 ); 294 295 foreach ($days as $day_key => $day_label) { 296 $day_enabled = isset($business_hours[$day_key]['enabled']) && $business_hours[$day_key]['enabled'] ? 'checked' : ''; 297 $day_start = isset($business_hours[$day_key]['start']) ? $business_hours[$day_key]['start'] : ''; 298 $day_end = isset($business_hours[$day_key]['end']) ? $business_hours[$day_key]['end'] : ''; 299 ?> 300 <div class="wcmlim-day-row"> 301 <div class="wcmlim-col-day"> 302 <label class="wcmlim-day-checkbox"> 303 <input type="checkbox" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][enabled]" value="1" <?php echo $day_enabled; ?> /> 304 <span class="wcmlim-day-label"><?php echo esc_html($day_label); ?></span> 305 </label> 306 </div> 307 <div class="wcmlim-col-opens"> 308 <input type="time" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][start]" value="<?php echo esc_attr($day_start); ?>" placeholder="09:00" /> 309 </div> 310 <div class="wcmlim-col-closes"> 311 <input type="time" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][end]" value="<?php echo esc_attr($day_end); ?>" placeholder="17:00" /> 312 </div> 313 </div> 314 <?php 315 } 316 ?> 317 </div> 318 <p class="description"><?php esc_html_e('Check the days this location is open and set the hours', 'multiloca-lite-multi-location-inventory'); ?></p> 227 319 </td> 228 320 </tr> … … 273 365 update_term_meta($term_id, 'wcmlim_phone', sanitize_text_field(wp_unslash($_POST['wcmlim_phone']))); 274 366 } 367 if (isset($_POST['wcmlim_hours']) && is_array($_POST['wcmlim_hours'])) { 368 $hours_data = array(); 369 foreach ($_POST['wcmlim_hours'] as $day => $data) { 370 $day = sanitize_key($day); 371 $hours_data[$day] = array( 372 'enabled' => isset($data['enabled']) ? 1 : 0, 373 'start' => isset($data['start']) ? sanitize_text_field($data['start']) : '', 374 'end' => isset($data['end']) ? sanitize_text_field($data['end']) : '' 375 ); 376 } 377 update_term_meta($term_id, 'wcmlim_business_hours', wp_json_encode($hours_data)); 378 } 275 379 if (isset($_POST['wcmlim_location_priority'])) { 276 380 update_term_meta($term_id, 'wcmlim_location_priority', intval($_POST['wcmlim_location_priority'])); … … 324 428 } 325 429 } 430 431 /** 432 * Format business hours for display 433 * 434 * @param int $location_id Location term ID 435 * @return string Formatted HTML of business hours 436 */ 437 public static function format_business_hours($location_id) { 438 $hours_json = get_term_meta($location_id, 'wcmlim_business_hours', true); 439 if (empty($hours_json)) { 440 return ''; 441 } 442 443 $hours = json_decode($hours_json, true); 444 if (!is_array($hours)) { 445 return ''; 446 } 447 448 $days_order = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'); 449 $days_labels = array( 450 'monday' => __('Monday', 'multiloca-lite-multi-location-inventory'), 451 'tuesday' => __('Tuesday', 'multiloca-lite-multi-location-inventory'), 452 'wednesday' => __('Wednesday', 'multiloca-lite-multi-location-inventory'), 453 'thursday' => __('Thursday', 'multiloca-lite-multi-location-inventory'), 454 'friday' => __('Friday', 'multiloca-lite-multi-location-inventory'), 455 'saturday' => __('Saturday', 'multiloca-lite-multi-location-inventory'), 456 'sunday' => __('Sunday', 'multiloca-lite-multi-location-inventory') 457 ); 458 459 $output = ''; 460 foreach ($days_order as $day) { 461 if (!isset($hours[$day])) { 462 continue; 463 } 464 465 $day_data = $hours[$day]; 466 $day_label = $days_labels[$day]; 467 468 if (!empty($day_data['enabled'])) { 469 $start_time = !empty($day_data['start']) ? $day_data['start'] : ''; 470 $end_time = !empty($day_data['end']) ? $day_data['end'] : ''; 471 472 if ($start_time && $end_time) { 473 $output .= '<div class="business-hours-day">'; 474 $output .= '<span class="day-name">' . esc_html($day_label) . ':</span> '; 475 $output .= '<span class="day-hours">' . esc_html($start_time) . ' - ' . esc_html($end_time) . '</span>'; 476 $output .= '</div>'; 477 } 478 } else { 479 $output .= '<div class="business-hours-day closed">'; 480 $output .= '<span class="day-name">' . esc_html($day_label) . ':</span> '; 481 $output .= '<span class="day-hours">' . esc_html__('Closed', 'multiloca-lite-multi-location-inventory') . '</span>'; 482 $output .= '</div>'; 483 } 484 } 485 486 return $output; 487 } 326 488 } 327 489 -
multiloca-lite-multi-location-inventory/tags/1.1.2/multiloca-lite-multi-location-inventory.php
r3396442 r3396942 106 106 // Public classes 107 107 require_once MULTILOCA_LITE_PLUGIN_PATH . 'public/class-multiloca-lite-public.php'; 108 require_once MULTILOCA_LITE_PLUGIN_PATH . 'public/class-multiloca-lite-location-filter-widget.php'; 109 require_once MULTILOCA_LITE_PLUGIN_PATH . 'public/class-multiloca-lite-shop-filter.php'; 108 110 //require generic files 109 111 require_once MULTILOCA_LITE_PLUGIN_PATH . 'includes/helper/multiloca-lite-inventory-helper.php'; -
multiloca-lite-multi-location-inventory/tags/1.1.2/public/controller/shop/views/multiloca-card-view.php
r3374381 r3396942 23 23 $show_email = get_option('wcmlim_enable_location_email', false); 24 24 $show_phone = get_option('wcmlim_enable_location_phone', false); 25 $show_business_hours = get_option('wcmlim_enable_location_business_hours', false); 25 26 26 27 // Get the product ID (handle both simple and variable products) … … 158 159 } 159 160 161 if ($show_business_hours === 'on') { 162 $business_hours = Multiloca_Lite_Taxonomy::format_business_hours($location->term_id); 163 if (!empty($business_hours)) { 164 echo '<div class="contact-item location-business-hours">'; 165 echo '<span class="contact-icon">🕒</span>'; 166 echo '<div class="contact-value">' . wp_kses_post($business_hours) . '</div>'; 167 echo '</div>'; 168 } 169 } 170 160 171 echo '</div>'; 161 172 } -
multiloca-lite-multi-location-inventory/tags/1.1.2/public/controller/shop/views/multiloca-expanded-view.php
r3374381 r3396942 23 23 $show_email = get_option('wcmlim_enable_location_email', false); 24 24 $show_phone = get_option('wcmlim_enable_location_phone', false); 25 $show_business_hours = get_option('wcmlim_enable_location_business_hours', false); 25 26 26 27 // Get the product ID (handle both simple and variable products) … … 166 167 } 167 168 169 if ($show_business_hours === 'on') { 170 $business_hours = Multiloca_Lite_Taxonomy::format_business_hours($location->term_id); 171 if (!empty($business_hours)) { 172 $has_contact = true; 173 $contact_parts[] = '<div class="hours-wrapper"><strong>' . esc_html__('Hours:', 'multiloca-lite-multi-location-inventory') . '</strong><br>' . $business_hours . '</div>'; 174 } 175 } 176 168 177 if ($has_contact) { 169 178 echo '<div class="multiloca-contact">'; -
multiloca-lite-multi-location-inventory/tags/1.1.2/public/controller/shop/views/multiloca-list-view.php
r3374381 r3396942 23 23 $show_email = get_option('wcmlim_enable_location_email', false); 24 24 $show_phone = get_option('wcmlim_enable_location_phone', false); 25 $show_business_hours = get_option('wcmlim_enable_location_business_hours', false); 25 26 26 27 // Get the product ID (handle both simple and variable products) … … 150 151 } 151 152 153 // Display business hours if enabled 154 if ($show_business_hours === 'on') { 155 $business_hours = Multiloca_Lite_Taxonomy::format_business_hours($location->term_id); 156 if (!empty($business_hours)) { 157 echo '<div class="location-business-hours">'; 158 echo wp_kses_post($business_hours); 159 echo '</div>'; 160 } 161 } 162 152 163 echo '</li>'; 153 164 } -
multiloca-lite-multi-location-inventory/tags/1.1.2/public/controller/shop/views/multiloca-simple-text-view.php
r3374381 r3396942 23 23 $show_email = get_option('wcmlim_enable_location_email', false); 24 24 $show_phone = get_option('wcmlim_enable_location_phone', false); 25 $show_business_hours = get_option('wcmlim_enable_location_business_hours', false); 25 26 26 27 // Get the product ID (handle both simple and variable products) … … 150 151 } 151 152 153 if ($show_business_hours === 'on') { 154 $business_hours = Multiloca_Lite_Taxonomy::format_business_hours($location->term_id); 155 if (!empty($business_hours)) { 156 echo '<div class="location-business-hours">'; 157 echo '🕒 ' . wp_kses_post($business_hours); 158 echo '</div>'; 159 } 160 } 161 152 162 if (!empty($contact_parts)) { 153 163 echo '<div class="location-contact">'; -
multiloca-lite-multi-location-inventory/tags/1.1.2/public/controller/shop/views/multiloca-table-view.php
r3374381 r3396942 23 23 $show_email = get_option('wcmlim_enable_location_email', false); 24 24 $show_phone = get_option('wcmlim_enable_location_phone', false); 25 $show_business_hours = get_option('wcmlim_enable_location_business_hours', false); 25 26 26 27 // Get the product ID (handle both simple and variable products) … … 156 157 } 157 158 159 // Display business hours if enabled 160 if ($show_business_hours === 'on') { 161 $business_hours = Multiloca_Lite_Taxonomy::format_business_hours($location->term_id); 162 if (!empty($business_hours)) { 163 $details[] = '<div class="location-business-hours">' . $business_hours . '</div>'; 164 } 165 } 166 158 167 // Display all details under stock if any exist 159 168 if (!empty($details)) { -
multiloca-lite-multi-location-inventory/tags/1.1.2/public/css/multiloca-lite-public.css
r3374381 r3396942 158 158 font-weight: 500; 159 159 } 160 161 /* Business hours styling */ 162 .location-business-hours { 163 margin-top: 8px; 164 } 165 166 .business-hours-day { 167 display: flex; 168 align-items: baseline; 169 padding: 3px 0; 170 font-size: 13px; 171 line-height: 1.6; 172 } 173 174 .business-hours-day .day-name { 175 font-weight: 600; 176 color: #333; 177 min-width: 90px; 178 flex-shrink: 0; 179 } 180 181 .business-hours-day .day-hours { 182 color: #555; 183 } 184 185 .business-hours-day.closed .day-hours { 186 color: #999; 187 font-style: italic; 188 } 189 190 .contact-business-hours { 191 display: inline-block; 192 vertical-align: top; 193 } 194 195 .hours-wrapper { 196 margin-top: 10px; 197 } 198 199 .hours-wrapper strong { 200 display: block; 201 margin-bottom: 5px; 202 color: #333; 203 } 204 205 /* Card view business hours specific styling */ 206 .multiloca-lite-location-card .location-business-hours .business-hours-day { 207 padding: 2px 0; 208 } 209 160 210 /* Expanded view */ 161 211 .multiloca-lite-location-expanded-item { … … 655 705 } 656 706 } 707 708 /* Location Filter Widget Styles */ 709 .multiloca-lite-location-filter-widget { 710 background: #f9f9f9; 711 border: 1px solid #e5e5e5; 712 border-radius: 8px; 713 padding: 0; 714 overflow: hidden; 715 } 716 717 .multiloca-lite-location-filter-widget .widgettitle, 718 .multiloca-lite-location-filter-widget .widget-title { 719 background: #fff; 720 padding: 15px; 721 margin: 0; 722 border-bottom: 2px solid #e5e5e5; 723 font-size: 16px; 724 font-weight: 600; 725 color: #333; 726 } 727 728 .multiloca-lite-location-filter-widget .filter-count { 729 color: #0071a1; 730 font-weight: 700; 731 font-size: 14px; 732 } 733 734 .multiloca-location-filter { 735 padding: 0; 736 } 737 738 .multiloca-location-filter-form { 739 padding: 15px; 740 } 741 742 .multiloca-location-filter-list { 743 margin: 0 0 15px 0; 744 max-height: 300px; 745 overflow-y: auto; 746 padding: 5px 0; 747 } 748 749 /* Custom scrollbar for filter list */ 750 .multiloca-location-filter-list::-webkit-scrollbar { 751 width: 8px; 752 } 753 754 .multiloca-location-filter-list::-webkit-scrollbar-track { 755 background: #f1f1f1; 756 border-radius: 4px; 757 } 758 759 .multiloca-location-filter-list::-webkit-scrollbar-thumb { 760 background: #ccc; 761 border-radius: 4px; 762 } 763 764 .multiloca-location-filter-list::-webkit-scrollbar-thumb:hover { 765 background: #999; 766 } 767 768 .multiloca-location-filter-item { 769 margin-bottom: 12px; 770 padding: 8px 12px; 771 border-radius: 4px; 772 transition: background-color 0.2s; 773 } 774 775 .multiloca-location-filter-item:hover { 776 background-color: rgba(0, 0, 0, 0.03); 777 } 778 779 .multiloca-location-filter-item label { 780 display: flex; 781 align-items: center; 782 margin: 0; 783 cursor: pointer; 784 font-size: 14px; 785 line-height: 1.6; 786 } 787 788 .multiloca-location-checkbox { 789 margin: 0 !important; 790 cursor: pointer; 791 width: 18px; 792 height: 18px; 793 flex-shrink: 0; 794 } 795 796 .multiloca-location-name { 797 flex: 1; 798 color: #333; 799 font-weight: 500; 800 margin-left: 12px; 801 padding-left: 2px; 802 } 803 804 .multiloca-location-count { 805 color: #666; 806 font-size: 13px; 807 margin-left: 5px; 808 } 809 810 .multiloca-location-filter-actions { 811 display: flex; 812 gap: 8px; 813 flex-wrap: wrap; 814 } 815 816 .multiloca-filter-apply, 817 .multiloca-filter-clear { 818 flex: 1; 819 min-width: 100px; 820 padding: 10px 15px; 821 border: none; 822 border-radius: 4px; 823 font-size: 14px; 824 font-weight: 600; 825 text-align: center; 826 cursor: pointer; 827 transition: all 0.2s; 828 text-decoration: none; 829 display: inline-block; 830 } 831 832 .multiloca-filter-apply { 833 background: #0071a1; 834 color: #fff; 835 } 836 837 .multiloca-filter-apply:hover { 838 background: #005a87; 839 color: #fff; 840 } 841 842 .multiloca-filter-clear { 843 background: #f5f5f5; 844 color: #666; 845 border: 1px solid #ddd; 846 } 847 848 .multiloca-filter-clear:hover { 849 background: #e5e5e5; 850 color: #333; 851 text-decoration: none; 852 } 853 854 /* Active filter indicator */ 855 .multiloca-location-filter.has-active-filters .multiloca-lite-location-filter-widget .widgettitle::before, 856 .multiloca-location-filter.has-active-filters .multiloca-lite-location-filter-widget .widget-title::before { 857 content: '●'; 858 color: #0071a1; 859 margin-right: 8px; 860 font-size: 14px; 861 } 862 863 /* Mobile responsive styles for filter widget */ 864 @media (max-width: 768px) { 865 .multiloca-location-filter-list { 866 max-height: 250px; 867 } 868 869 .multiloca-location-filter-item label { 870 font-size: 13px; 871 } 872 873 .multiloca-filter-apply, 874 .multiloca-filter-clear { 875 padding: 8px 12px; 876 font-size: 13px; 877 } 878 } 879 880 @media (max-width: 480px) { 881 .multiloca-location-filter-actions { 882 flex-direction: column; 883 } 884 885 .multiloca-filter-apply, 886 .multiloca-filter-clear { 887 width: 100%; 888 min-width: auto; 889 } 890 } -
multiloca-lite-multi-location-inventory/tags/1.1.2/uninstall.php
r3377945 r3396942 20 20 'wcmlim_custom_css', 21 21 'wcmlim_enable_location_selection', 22 'wcmlim_enable_shop_filter', 22 23 'wcmlim_enable_location_address', 23 24 'wcmlim_enable_location_city', … … 26 27 'wcmlim_enable_location_email', 27 28 'wcmlim_enable_location_phone', 29 'wcmlim_enable_location_business_hours', 28 30 'wcmlim_listing_preset_location', 29 31 'wcmlim_enable_default_location', -
multiloca-lite-multi-location-inventory/trunk/admin/class-multiloca-lite-admin.php
r3377945 r3396942 168 168 // Register location display settings 169 169 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_selection', array('sanitize_callback' => 'sanitize_text_field')); 170 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_shop_filter', array('sanitize_callback' => 'sanitize_text_field')); 170 171 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_address', array('sanitize_callback' => 'sanitize_text_field')); 171 172 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_city', array('sanitize_callback' => 'sanitize_text_field')); … … 175 176 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_email', array('sanitize_callback' => 'sanitize_text_field')); 176 177 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_phone', array('sanitize_callback' => 'sanitize_text_field')); 178 register_setting('multiloca_lite_location_settings', 'wcmlim_enable_location_business_hours', array('sanitize_callback' => 'sanitize_text_field')); 177 179 register_setting('multiloca_lite_location_settings', 'wcmlim_listing_preset_location', array('sanitize_callback' => 'sanitize_text_field')); 178 180 … … 289 291 290 292 add_settings_field( 293 'wcmlim_enable_shop_filter', 294 __('Enable Location Filtering On Shop Page', 'multiloca-lite-multi-location-inventory'), 295 array($this, 'render_checkbox_field'), 296 'multiloca-lite-location-settings', 297 'multiloca_lite_location_section', 298 array( 299 'id' => 'wcmlim_enable_shop_filter', 300 'tooltip' => __('How it works: 1) Enable this setting 2) Go to Appearance → Widgets 3) Add "Multiloca Location Filter" widget to your shop sidebar 4) Customers can then filter products by selecting multiple locations using checkboxes. The widget only appears on shop and product archive pages.', 'multiloca-lite-multi-location-inventory'), 301 'description' => __('When enabled, a location filter widget will be available to add to sidebars on shop and archive pages. Customers can filter products by selecting one or multiple locations.', 'multiloca-lite-multi-location-inventory') 302 ) 303 ); 304 305 add_settings_field( 291 306 'wcmlim_listing_preset_location', 292 307 __('Order Locations By', 'multiloca-lite-multi-location-inventory'), … … 388 403 ) 389 404 ); 405 406 add_settings_field( 407 'wcmlim_enable_location_business_hours', 408 __('Show Business Hours', 'multiloca-lite-multi-location-inventory'), 409 array($this, 'render_checkbox_field'), 410 'multiloca-lite-location-settings', 411 'multiloca_lite_location_section', 412 array( 413 'id' => 'wcmlim_enable_location_business_hours', 414 'description' => __('Display business hours on frontend location views', 'multiloca-lite-multi-location-inventory') 415 ) 416 ); 390 417 } 391 418 … … 397 424 $value = get_option($id, ''); 398 425 echo '<input type="checkbox" id="' . esc_attr($id) . '" name="' . esc_attr($id) . '" value="on" ' . checked($value, 'on', false) . '>'; 426 427 // Add tooltip if provided 428 if (!empty($args['tooltip'])) { 429 echo ' <span class="dashicons dashicons-editor-help multiloca-tooltip" title="' . esc_attr($args['tooltip']) . '" style="cursor: help; color: #666; font-size: 18px; vertical-align: middle;"></span>'; 430 } 431 399 432 if (!empty($args['description'])) { 400 433 echo '<p class="description">' . esc_html($args['description']) . '</p>'; -
multiloca-lite-multi-location-inventory/trunk/admin/css/multiloca-lite-admin.css
r3374381 r3396942 10 10 .form-field textarea { 11 11 width: 95%; 12 } 13 14 /* Tooltip styling */ 15 .multiloca-tooltip { 16 position: relative; 17 display: inline-block; 18 } 19 20 .multiloca-tooltip:hover::after { 21 content: attr(title); 22 position: absolute; 23 left: 50%; 24 bottom: 125%; 25 transform: translateX(-50%); 26 background-color: #000; 27 color: #fff; 28 padding: 8px 12px; 29 border-radius: 4px; 30 white-space: normal; 31 width: 300px; 32 font-size: 13px; 33 line-height: 1.5; 34 z-index: 1000; 35 box-shadow: 0 2px 8px rgba(0,0,0,0.2); 36 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; 37 font-weight: normal; 38 } 39 40 .multiloca-tooltip:hover::before { 41 content: ''; 42 position: absolute; 43 left: 50%; 44 bottom: 115%; 45 transform: translateX(-50%); 46 border: 6px solid transparent; 47 border-top-color: #000; 48 z-index: 1001; 49 } 50 51 /* Business Hours Interface Styling */ 52 .wcmlim-business-hours-container { 53 max-width: 700px; 54 border: 1px solid #ddd; 55 border-radius: 4px; 56 overflow: hidden; 57 } 58 59 .wcmlim-hours-header { 60 display: flex; 61 align-items: center; 62 background-color: #f5f5f5; 63 padding: 12px 15px; 64 border-bottom: 2px solid #ddd; 65 font-weight: 600; 66 color: #333; 67 } 68 69 .wcmlim-day-row { 70 display: flex; 71 align-items: center; 72 padding: 10px 15px; 73 border-bottom: 1px solid #e5e5e5; 74 transition: background-color 0.2s; 75 } 76 77 .wcmlim-day-row:hover { 78 background-color: #f9f9f9; 79 } 80 81 .wcmlim-day-row:last-child { 82 border-bottom: none; 83 } 84 85 .wcmlim-col-day { 86 flex: 0 0 150px; 87 } 88 89 .wcmlim-col-opens, 90 .wcmlim-col-closes { 91 flex: 0 0 150px; 92 padding: 0 10px; 93 } 94 95 .wcmlim-day-checkbox { 96 display: flex; 97 align-items: center; 98 cursor: pointer; 99 margin: 0; 100 } 101 102 .wcmlim-day-checkbox input[type="checkbox"] { 103 margin: 0 10px 0 0; 104 cursor: pointer; 105 } 106 107 .wcmlim-day-label { 108 font-weight: 500; 109 color: #333; 110 } 111 112 .wcmlim-col-opens input[type="time"], 113 .wcmlim-col-closes input[type="time"] { 114 width: 120px; 115 padding: 6px 8px; 116 border: 1px solid #ddd; 117 border-radius: 4px; 118 font-size: 14px; 119 } 120 121 .wcmlim-col-opens input[type="time"]:focus, 122 .wcmlim-col-closes input[type="time"]:focus { 123 border-color: #2271b1; 124 outline: none; 125 box-shadow: 0 0 0 1px #2271b1; 12 126 } 13 127 -
multiloca-lite-multi-location-inventory/trunk/includes/class-multiloca-lite-activator.php
r3377945 r3396942 40 40 'wcmlim_txt_in_btn_outofstock' => __('Out of Stock', 'multiloca-lite-multi-location-inventory'), 41 41 'wcmlim_listing_preset_location' => 'alphabetical', 42 'wcmlim_enable_location_selection' => 'on' 42 'wcmlim_enable_location_selection' => 'on', 43 'wcmlim_enable_shop_filter' => '' 43 44 ); 44 45 -
multiloca-lite-multi-location-inventory/trunk/includes/class-multiloca-lite-taxonomy.php
r3336945 r3396942 79 79 register_term_meta('locations-lite', 'wcmlim_email', ['show_in_rest' => true]); 80 80 register_term_meta('locations-lite', 'wcmlim_phone', ['show_in_rest' => true]); 81 register_term_meta('locations-lite', 'wcmlim_business_hours', ['show_in_rest' => true]); 81 82 register_term_meta('locations-lite', 'wcmlim_location_priority', ['show_in_rest' => true]); 82 83 register_term_meta('locations-lite', 'wcmlim_start_time', ['show_in_rest' => true]); … … 139 140 </div> 140 141 <div class="form-field"> 142 <label><?php esc_html_e('Business Hours', 'multiloca-lite-multi-location-inventory'); ?></label> 143 <div class="wcmlim-business-hours-container"> 144 <div class="wcmlim-hours-header"> 145 <div class="wcmlim-col-day"><?php esc_html_e('Day', 'multiloca-lite-multi-location-inventory'); ?></div> 146 <div class="wcmlim-col-opens"><?php esc_html_e('Opens At', 'multiloca-lite-multi-location-inventory'); ?></div> 147 <div class="wcmlim-col-closes"><?php esc_html_e('Closes At', 'multiloca-lite-multi-location-inventory'); ?></div> 148 </div> 149 <?php 150 $days = array( 151 'monday' => __('Monday', 'multiloca-lite-multi-location-inventory'), 152 'tuesday' => __('Tuesday', 'multiloca-lite-multi-location-inventory'), 153 'wednesday' => __('Wednesday', 'multiloca-lite-multi-location-inventory'), 154 'thursday' => __('Thursday', 'multiloca-lite-multi-location-inventory'), 155 'friday' => __('Friday', 'multiloca-lite-multi-location-inventory'), 156 'saturday' => __('Saturday', 'multiloca-lite-multi-location-inventory'), 157 'sunday' => __('Sunday', 'multiloca-lite-multi-location-inventory') 158 ); 159 160 foreach ($days as $day_key => $day_label) { 161 ?> 162 <div class="wcmlim-day-row"> 163 <div class="wcmlim-col-day"> 164 <label class="wcmlim-day-checkbox"> 165 <input type="checkbox" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][enabled]" value="1" /> 166 <span class="wcmlim-day-label"><?php echo esc_html($day_label); ?></span> 167 </label> 168 </div> 169 <div class="wcmlim-col-opens"> 170 <input type="time" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][start]" placeholder="09:00" /> 171 </div> 172 <div class="wcmlim-col-closes"> 173 <input type="time" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][end]" placeholder="17:00" /> 174 </div> 175 </div> 176 <?php 177 } 178 ?> 179 </div> 180 <p class="description"><?php esc_html_e('Check the days this location is open and set the hours', 'multiloca-lite-multi-location-inventory'); ?></p> 181 </div> 182 <div class="form-field"> 141 183 <label for="wcmlim_location_priority"><?php esc_html_e('Display Order', 'multiloca-lite-multi-location-inventory'); ?></label> 142 184 <input type="number" name="wcmlim_location_priority" id="wcmlim_location_priority" value="0" /> … … 159 201 $email = get_term_meta($term->term_id, 'wcmlim_email', true); 160 202 $phone = get_term_meta($term->term_id, 'wcmlim_phone', true); 203 $business_hours_json = get_term_meta($term->term_id, 'wcmlim_business_hours', true); 204 $business_hours = !empty($business_hours_json) ? json_decode($business_hours_json, true) : array(); 161 205 $priority = get_term_meta($term->term_id, 'wcmlim_location_priority', true); 162 206 if (empty($priority)) { … … 225 269 <input type="text" name="wcmlim_phone" id="wcmlim_phone" value="<?php echo esc_attr($phone); ?>" /> 226 270 <p class="description"><?php esc_html_e('Enter phone for this location', 'multiloca-lite-multi-location-inventory'); ?></p> 271 </td> 272 </tr> 273 <tr class="form-field"> 274 <th scope="row" valign="top"> 275 <label><?php esc_html_e('Business Hours', 'multiloca-lite-multi-location-inventory'); ?></label> 276 </th> 277 <td> 278 <div class="wcmlim-business-hours-container"> 279 <div class="wcmlim-hours-header"> 280 <div class="wcmlim-col-day"><?php esc_html_e('Day', 'multiloca-lite-multi-location-inventory'); ?></div> 281 <div class="wcmlim-col-opens"><?php esc_html_e('Opens At', 'multiloca-lite-multi-location-inventory'); ?></div> 282 <div class="wcmlim-col-closes"><?php esc_html_e('Closes At', 'multiloca-lite-multi-location-inventory'); ?></div> 283 </div> 284 <?php 285 $days = array( 286 'monday' => __('Monday', 'multiloca-lite-multi-location-inventory'), 287 'tuesday' => __('Tuesday', 'multiloca-lite-multi-location-inventory'), 288 'wednesday' => __('Wednesday', 'multiloca-lite-multi-location-inventory'), 289 'thursday' => __('Thursday', 'multiloca-lite-multi-location-inventory'), 290 'friday' => __('Friday', 'multiloca-lite-multi-location-inventory'), 291 'saturday' => __('Saturday', 'multiloca-lite-multi-location-inventory'), 292 'sunday' => __('Sunday', 'multiloca-lite-multi-location-inventory') 293 ); 294 295 foreach ($days as $day_key => $day_label) { 296 $day_enabled = isset($business_hours[$day_key]['enabled']) && $business_hours[$day_key]['enabled'] ? 'checked' : ''; 297 $day_start = isset($business_hours[$day_key]['start']) ? $business_hours[$day_key]['start'] : ''; 298 $day_end = isset($business_hours[$day_key]['end']) ? $business_hours[$day_key]['end'] : ''; 299 ?> 300 <div class="wcmlim-day-row"> 301 <div class="wcmlim-col-day"> 302 <label class="wcmlim-day-checkbox"> 303 <input type="checkbox" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][enabled]" value="1" <?php echo $day_enabled; ?> /> 304 <span class="wcmlim-day-label"><?php echo esc_html($day_label); ?></span> 305 </label> 306 </div> 307 <div class="wcmlim-col-opens"> 308 <input type="time" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][start]" value="<?php echo esc_attr($day_start); ?>" placeholder="09:00" /> 309 </div> 310 <div class="wcmlim-col-closes"> 311 <input type="time" name="wcmlim_hours[<?php echo esc_attr($day_key); ?>][end]" value="<?php echo esc_attr($day_end); ?>" placeholder="17:00" /> 312 </div> 313 </div> 314 <?php 315 } 316 ?> 317 </div> 318 <p class="description"><?php esc_html_e('Check the days this location is open and set the hours', 'multiloca-lite-multi-location-inventory'); ?></p> 227 319 </td> 228 320 </tr> … … 273 365 update_term_meta($term_id, 'wcmlim_phone', sanitize_text_field(wp_unslash($_POST['wcmlim_phone']))); 274 366 } 367 if (isset($_POST['wcmlim_hours']) && is_array($_POST['wcmlim_hours'])) { 368 $hours_data = array(); 369 foreach ($_POST['wcmlim_hours'] as $day => $data) { 370 $day = sanitize_key($day); 371 $hours_data[$day] = array( 372 'enabled' => isset($data['enabled']) ? 1 : 0, 373 'start' => isset($data['start']) ? sanitize_text_field($data['start']) : '', 374 'end' => isset($data['end']) ? sanitize_text_field($data['end']) : '' 375 ); 376 } 377 update_term_meta($term_id, 'wcmlim_business_hours', wp_json_encode($hours_data)); 378 } 275 379 if (isset($_POST['wcmlim_location_priority'])) { 276 380 update_term_meta($term_id, 'wcmlim_location_priority', intval($_POST['wcmlim_location_priority'])); … … 324 428 } 325 429 } 430 431 /** 432 * Format business hours for display 433 * 434 * @param int $location_id Location term ID 435 * @return string Formatted HTML of business hours 436 */ 437 public static function format_business_hours($location_id) { 438 $hours_json = get_term_meta($location_id, 'wcmlim_business_hours', true); 439 if (empty($hours_json)) { 440 return ''; 441 } 442 443 $hours = json_decode($hours_json, true); 444 if (!is_array($hours)) { 445 return ''; 446 } 447 448 $days_order = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'); 449 $days_labels = array( 450 'monday' => __('Monday', 'multiloca-lite-multi-location-inventory'), 451 'tuesday' => __('Tuesday', 'multiloca-lite-multi-location-inventory'), 452 'wednesday' => __('Wednesday', 'multiloca-lite-multi-location-inventory'), 453 'thursday' => __('Thursday', 'multiloca-lite-multi-location-inventory'), 454 'friday' => __('Friday', 'multiloca-lite-multi-location-inventory'), 455 'saturday' => __('Saturday', 'multiloca-lite-multi-location-inventory'), 456 'sunday' => __('Sunday', 'multiloca-lite-multi-location-inventory') 457 ); 458 459 $output = ''; 460 foreach ($days_order as $day) { 461 if (!isset($hours[$day])) { 462 continue; 463 } 464 465 $day_data = $hours[$day]; 466 $day_label = $days_labels[$day]; 467 468 if (!empty($day_data['enabled'])) { 469 $start_time = !empty($day_data['start']) ? $day_data['start'] : ''; 470 $end_time = !empty($day_data['end']) ? $day_data['end'] : ''; 471 472 if ($start_time && $end_time) { 473 $output .= '<div class="business-hours-day">'; 474 $output .= '<span class="day-name">' . esc_html($day_label) . ':</span> '; 475 $output .= '<span class="day-hours">' . esc_html($start_time) . ' - ' . esc_html($end_time) . '</span>'; 476 $output .= '</div>'; 477 } 478 } else { 479 $output .= '<div class="business-hours-day closed">'; 480 $output .= '<span class="day-name">' . esc_html($day_label) . ':</span> '; 481 $output .= '<span class="day-hours">' . esc_html__('Closed', 'multiloca-lite-multi-location-inventory') . '</span>'; 482 $output .= '</div>'; 483 } 484 } 485 486 return $output; 487 } 326 488 } 327 489 -
multiloca-lite-multi-location-inventory/trunk/multiloca-lite-multi-location-inventory.php
r3396442 r3396942 106 106 // Public classes 107 107 require_once MULTILOCA_LITE_PLUGIN_PATH . 'public/class-multiloca-lite-public.php'; 108 require_once MULTILOCA_LITE_PLUGIN_PATH . 'public/class-multiloca-lite-location-filter-widget.php'; 109 require_once MULTILOCA_LITE_PLUGIN_PATH . 'public/class-multiloca-lite-shop-filter.php'; 108 110 //require generic files 109 111 require_once MULTILOCA_LITE_PLUGIN_PATH . 'includes/helper/multiloca-lite-inventory-helper.php'; -
multiloca-lite-multi-location-inventory/trunk/public/controller/shop/views/multiloca-card-view.php
r3374381 r3396942 23 23 $show_email = get_option('wcmlim_enable_location_email', false); 24 24 $show_phone = get_option('wcmlim_enable_location_phone', false); 25 $show_business_hours = get_option('wcmlim_enable_location_business_hours', false); 25 26 26 27 // Get the product ID (handle both simple and variable products) … … 158 159 } 159 160 161 if ($show_business_hours === 'on') { 162 $business_hours = Multiloca_Lite_Taxonomy::format_business_hours($location->term_id); 163 if (!empty($business_hours)) { 164 echo '<div class="contact-item location-business-hours">'; 165 echo '<span class="contact-icon">🕒</span>'; 166 echo '<div class="contact-value">' . wp_kses_post($business_hours) . '</div>'; 167 echo '</div>'; 168 } 169 } 170 160 171 echo '</div>'; 161 172 } -
multiloca-lite-multi-location-inventory/trunk/public/controller/shop/views/multiloca-expanded-view.php
r3374381 r3396942 23 23 $show_email = get_option('wcmlim_enable_location_email', false); 24 24 $show_phone = get_option('wcmlim_enable_location_phone', false); 25 $show_business_hours = get_option('wcmlim_enable_location_business_hours', false); 25 26 26 27 // Get the product ID (handle both simple and variable products) … … 166 167 } 167 168 169 if ($show_business_hours === 'on') { 170 $business_hours = Multiloca_Lite_Taxonomy::format_business_hours($location->term_id); 171 if (!empty($business_hours)) { 172 $has_contact = true; 173 $contact_parts[] = '<div class="hours-wrapper"><strong>' . esc_html__('Hours:', 'multiloca-lite-multi-location-inventory') . '</strong><br>' . $business_hours . '</div>'; 174 } 175 } 176 168 177 if ($has_contact) { 169 178 echo '<div class="multiloca-contact">'; -
multiloca-lite-multi-location-inventory/trunk/public/controller/shop/views/multiloca-list-view.php
r3374381 r3396942 23 23 $show_email = get_option('wcmlim_enable_location_email', false); 24 24 $show_phone = get_option('wcmlim_enable_location_phone', false); 25 $show_business_hours = get_option('wcmlim_enable_location_business_hours', false); 25 26 26 27 // Get the product ID (handle both simple and variable products) … … 150 151 } 151 152 153 // Display business hours if enabled 154 if ($show_business_hours === 'on') { 155 $business_hours = Multiloca_Lite_Taxonomy::format_business_hours($location->term_id); 156 if (!empty($business_hours)) { 157 echo '<div class="location-business-hours">'; 158 echo wp_kses_post($business_hours); 159 echo '</div>'; 160 } 161 } 162 152 163 echo '</li>'; 153 164 } -
multiloca-lite-multi-location-inventory/trunk/public/controller/shop/views/multiloca-simple-text-view.php
r3374381 r3396942 23 23 $show_email = get_option('wcmlim_enable_location_email', false); 24 24 $show_phone = get_option('wcmlim_enable_location_phone', false); 25 $show_business_hours = get_option('wcmlim_enable_location_business_hours', false); 25 26 26 27 // Get the product ID (handle both simple and variable products) … … 150 151 } 151 152 153 if ($show_business_hours === 'on') { 154 $business_hours = Multiloca_Lite_Taxonomy::format_business_hours($location->term_id); 155 if (!empty($business_hours)) { 156 echo '<div class="location-business-hours">'; 157 echo '🕒 ' . wp_kses_post($business_hours); 158 echo '</div>'; 159 } 160 } 161 152 162 if (!empty($contact_parts)) { 153 163 echo '<div class="location-contact">'; -
multiloca-lite-multi-location-inventory/trunk/public/controller/shop/views/multiloca-table-view.php
r3374381 r3396942 23 23 $show_email = get_option('wcmlim_enable_location_email', false); 24 24 $show_phone = get_option('wcmlim_enable_location_phone', false); 25 $show_business_hours = get_option('wcmlim_enable_location_business_hours', false); 25 26 26 27 // Get the product ID (handle both simple and variable products) … … 156 157 } 157 158 159 // Display business hours if enabled 160 if ($show_business_hours === 'on') { 161 $business_hours = Multiloca_Lite_Taxonomy::format_business_hours($location->term_id); 162 if (!empty($business_hours)) { 163 $details[] = '<div class="location-business-hours">' . $business_hours . '</div>'; 164 } 165 } 166 158 167 // Display all details under stock if any exist 159 168 if (!empty($details)) { -
multiloca-lite-multi-location-inventory/trunk/public/css/multiloca-lite-public.css
r3374381 r3396942 158 158 font-weight: 500; 159 159 } 160 161 /* Business hours styling */ 162 .location-business-hours { 163 margin-top: 8px; 164 } 165 166 .business-hours-day { 167 display: flex; 168 align-items: baseline; 169 padding: 3px 0; 170 font-size: 13px; 171 line-height: 1.6; 172 } 173 174 .business-hours-day .day-name { 175 font-weight: 600; 176 color: #333; 177 min-width: 90px; 178 flex-shrink: 0; 179 } 180 181 .business-hours-day .day-hours { 182 color: #555; 183 } 184 185 .business-hours-day.closed .day-hours { 186 color: #999; 187 font-style: italic; 188 } 189 190 .contact-business-hours { 191 display: inline-block; 192 vertical-align: top; 193 } 194 195 .hours-wrapper { 196 margin-top: 10px; 197 } 198 199 .hours-wrapper strong { 200 display: block; 201 margin-bottom: 5px; 202 color: #333; 203 } 204 205 /* Card view business hours specific styling */ 206 .multiloca-lite-location-card .location-business-hours .business-hours-day { 207 padding: 2px 0; 208 } 209 160 210 /* Expanded view */ 161 211 .multiloca-lite-location-expanded-item { … … 655 705 } 656 706 } 707 708 /* Location Filter Widget Styles */ 709 .multiloca-lite-location-filter-widget { 710 background: #f9f9f9; 711 border: 1px solid #e5e5e5; 712 border-radius: 8px; 713 padding: 0; 714 overflow: hidden; 715 } 716 717 .multiloca-lite-location-filter-widget .widgettitle, 718 .multiloca-lite-location-filter-widget .widget-title { 719 background: #fff; 720 padding: 15px; 721 margin: 0; 722 border-bottom: 2px solid #e5e5e5; 723 font-size: 16px; 724 font-weight: 600; 725 color: #333; 726 } 727 728 .multiloca-lite-location-filter-widget .filter-count { 729 color: #0071a1; 730 font-weight: 700; 731 font-size: 14px; 732 } 733 734 .multiloca-location-filter { 735 padding: 0; 736 } 737 738 .multiloca-location-filter-form { 739 padding: 15px; 740 } 741 742 .multiloca-location-filter-list { 743 margin: 0 0 15px 0; 744 max-height: 300px; 745 overflow-y: auto; 746 padding: 5px 0; 747 } 748 749 /* Custom scrollbar for filter list */ 750 .multiloca-location-filter-list::-webkit-scrollbar { 751 width: 8px; 752 } 753 754 .multiloca-location-filter-list::-webkit-scrollbar-track { 755 background: #f1f1f1; 756 border-radius: 4px; 757 } 758 759 .multiloca-location-filter-list::-webkit-scrollbar-thumb { 760 background: #ccc; 761 border-radius: 4px; 762 } 763 764 .multiloca-location-filter-list::-webkit-scrollbar-thumb:hover { 765 background: #999; 766 } 767 768 .multiloca-location-filter-item { 769 margin-bottom: 12px; 770 padding: 8px 12px; 771 border-radius: 4px; 772 transition: background-color 0.2s; 773 } 774 775 .multiloca-location-filter-item:hover { 776 background-color: rgba(0, 0, 0, 0.03); 777 } 778 779 .multiloca-location-filter-item label { 780 display: flex; 781 align-items: center; 782 margin: 0; 783 cursor: pointer; 784 font-size: 14px; 785 line-height: 1.6; 786 } 787 788 .multiloca-location-checkbox { 789 margin: 0 !important; 790 cursor: pointer; 791 width: 18px; 792 height: 18px; 793 flex-shrink: 0; 794 } 795 796 .multiloca-location-name { 797 flex: 1; 798 color: #333; 799 font-weight: 500; 800 margin-left: 12px; 801 padding-left: 2px; 802 } 803 804 .multiloca-location-count { 805 color: #666; 806 font-size: 13px; 807 margin-left: 5px; 808 } 809 810 .multiloca-location-filter-actions { 811 display: flex; 812 gap: 8px; 813 flex-wrap: wrap; 814 } 815 816 .multiloca-filter-apply, 817 .multiloca-filter-clear { 818 flex: 1; 819 min-width: 100px; 820 padding: 10px 15px; 821 border: none; 822 border-radius: 4px; 823 font-size: 14px; 824 font-weight: 600; 825 text-align: center; 826 cursor: pointer; 827 transition: all 0.2s; 828 text-decoration: none; 829 display: inline-block; 830 } 831 832 .multiloca-filter-apply { 833 background: #0071a1; 834 color: #fff; 835 } 836 837 .multiloca-filter-apply:hover { 838 background: #005a87; 839 color: #fff; 840 } 841 842 .multiloca-filter-clear { 843 background: #f5f5f5; 844 color: #666; 845 border: 1px solid #ddd; 846 } 847 848 .multiloca-filter-clear:hover { 849 background: #e5e5e5; 850 color: #333; 851 text-decoration: none; 852 } 853 854 /* Active filter indicator */ 855 .multiloca-location-filter.has-active-filters .multiloca-lite-location-filter-widget .widgettitle::before, 856 .multiloca-location-filter.has-active-filters .multiloca-lite-location-filter-widget .widget-title::before { 857 content: '●'; 858 color: #0071a1; 859 margin-right: 8px; 860 font-size: 14px; 861 } 862 863 /* Mobile responsive styles for filter widget */ 864 @media (max-width: 768px) { 865 .multiloca-location-filter-list { 866 max-height: 250px; 867 } 868 869 .multiloca-location-filter-item label { 870 font-size: 13px; 871 } 872 873 .multiloca-filter-apply, 874 .multiloca-filter-clear { 875 padding: 8px 12px; 876 font-size: 13px; 877 } 878 } 879 880 @media (max-width: 480px) { 881 .multiloca-location-filter-actions { 882 flex-direction: column; 883 } 884 885 .multiloca-filter-apply, 886 .multiloca-filter-clear { 887 width: 100%; 888 min-width: auto; 889 } 890 } -
multiloca-lite-multi-location-inventory/trunk/uninstall.php
r3377945 r3396942 20 20 'wcmlim_custom_css', 21 21 'wcmlim_enable_location_selection', 22 'wcmlim_enable_shop_filter', 22 23 'wcmlim_enable_location_address', 23 24 'wcmlim_enable_location_city', … … 26 27 'wcmlim_enable_location_email', 27 28 'wcmlim_enable_location_phone', 29 'wcmlim_enable_location_business_hours', 28 30 'wcmlim_listing_preset_location', 29 31 'wcmlim_enable_default_location',
Note: See TracChangeset
for help on using the changeset viewer.