2nd update
This commit is contained in:
@@ -125,14 +125,6 @@ if (isset($_SESSION['account_loggedin'])) {
|
||||
if (!empty($identity)){$identity = json_decode($identity,true);}else{$identity = null;}
|
||||
$identity = $identity[0];
|
||||
|
||||
//CALL TO API FOR shipping
|
||||
$api_url = '/v2/taxes/';
|
||||
$countries = ioAPIv2($api_url,'',$clientsecret);
|
||||
//Decode Payload
|
||||
if (!empty($countries)){$countries = json_decode($countries,true);}else{$countries = null;}
|
||||
//CountryID mapping
|
||||
$countryMap = array_column($countries, 'country', 'id');
|
||||
|
||||
// Update settings
|
||||
if (isset($_POST['save_details'], $_POST['email'], $_POST['password'])) {
|
||||
// Assign and validate input data
|
||||
@@ -184,16 +176,17 @@ if (isset($_SESSION['account_loggedin'])) {
|
||||
}
|
||||
}
|
||||
|
||||
template_header($myaccount_text);
|
||||
$view = template_header($myaccount_text,'');
|
||||
|
||||
$view = '
|
||||
$view .= '
|
||||
|
||||
<div class="myaccount content-wrapper">';
|
||||
';
|
||||
|
||||
if(!isset($_SESSION['account_loggedin'])){
|
||||
|
||||
$view .= '<div class="login-register">
|
||||
|
||||
$view .= '
|
||||
<div class="login content-wrapper">
|
||||
<div class="login-register">
|
||||
<div class="login">
|
||||
|
||||
<h1>'.$h1_login.'</h1>
|
||||
@@ -249,8 +242,10 @@ $view .= ' </div>
|
||||
|
||||
} else {
|
||||
|
||||
$view .= '<h1>'.$h1_myaccount.'</h1>
|
||||
$view .= '
|
||||
|
||||
<div class="myaccount content-wrapper">
|
||||
<h1>'.$h1_myaccount.'</h1>
|
||||
<div class="menu">
|
||||
|
||||
<h2>'.$h2_menu.'</h2>
|
||||
@@ -352,8 +347,8 @@ elseif($tab == 'settings'){
|
||||
<label for="address_country" class="form-label">'.$shipping_country.'</label>
|
||||
<select id="address_country" name="address_country" required class="form-field">';
|
||||
|
||||
foreach($countries as $country){
|
||||
$view .= ' <option value="'.$country['id'].'" '.($country['id']==$identity['address_country'] ? ' selected' : '').'>'.(${$countryMap[$country['id']]} ?? $countryMap[$country['id']]).'</option>';
|
||||
foreach($countries_in_scope as $key => $value){
|
||||
$view .= ' <option value="'.$key.'" '.($key==$identity['address_country'] ? ' selected' : '').'>'.(${$value} ?? $value).'</option>';
|
||||
}
|
||||
$view .= '
|
||||
</select>
|
||||
@@ -368,7 +363,8 @@ elseif($tab == 'settings'){
|
||||
}
|
||||
$view .= '</div>';
|
||||
|
||||
$view .= template_footer();
|
||||
|
||||
//OUTPUT
|
||||
echo $view;
|
||||
|
||||
template_footer();
|
||||
Reference in New Issue
Block a user