Changeset 3112236
- Timestamp:
- 07/04/2024 08:11:15 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
exly-wp/trunk/public/partials/exly-wp-public-modern.php
r2872372 r3112236 1 1 <?php 2 2 3 /* 3 4 //$timezone = $this->display_time_zone_callback(); 4 5 //print_r($timezone); … … 11 12 $currencyName = 'USD'; 12 13 } 14 */ 15 16 function isBrowser() { 17 return isset($_SERVER['HTTP_USER_AGENT']); 18 } 19 20 function getLocalStorageItem($key) { 21 return isset($_COOKIE[$key]) ? $_COOKIE[$key] : null; 22 } 23 24 function setLocalStorageItem($key, $value) { 25 setcookie($key, $value, time() + (86400 * 30), "/"); 26 } 27 28 const TIMEZONE_LOCAL_STORAGE_KEYS = [ 29 'SYSTEM_TIMEZONE' => 'system_timezone' 30 ]; 31 32 if (!isBrowser()) { 33 echo 'DEFAULT_TIMEZONE'; 34 return; 35 } 36 37 $cachedTimezone = getLocalStorageItem(TIMEZONE_LOCAL_STORAGE_KEYS['SYSTEM_TIMEZONE']); 38 if ($cachedTimezone) { 39 $timezone = $cachedTimezone; 40 } else { 41 $timezone = 'UTC'; // Default if no cookie is set yet 42 } 43 44 //echo "Timezone: " . $timezone . "<br>"; 45 46 if ($timezone == 'Asia/Calcutta') { 47 $currencySymbol = '₹'; 48 $currencyName = 'INR'; 49 } else { 50 $currencySymbol = '$'; 51 $currencyName = 'USD'; 52 } 53 54 //echo "Currency Symbol: " . $currencySymbol . "<br>"; 55 //echo "Currency Name: " . $currencyName . "<br>"; 56 13 57 14 58 $isCategorized = $this->get_categorise_type();
Note: See TracChangeset
for help on using the changeset viewer.