CMXX - First testing
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"php.version": "8.4"
|
||||||
|
}
|
||||||
@@ -31,10 +31,10 @@ if (!isset($_SESSION['account_loggedin'])) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
// If the user is not admin redirect them back to the shopping cart home page
|
// If the user is not admin redirect them back to the shopping cart home page
|
||||||
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE id = ?');
|
$account = ioAPIv2('/v2/identity/userkey='.$_SESSION['account_id'].'&isverified=1','',$clientsecret);
|
||||||
$stmt->execute([ $_SESSION['account_id'] ]);
|
$account = json_decode($account,true);
|
||||||
$account = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
||||||
if (!$account || $account['role'] != 'Admin') {
|
if (!$account || $account[0]['profile'] != 1) {
|
||||||
header('Location: ' . url('../index.php'));
|
header('Location: ' . url('../index.php'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
91
checkout.php
@@ -6,7 +6,7 @@ defined(security_key) or exit;
|
|||||||
// Defaults
|
// Defaults
|
||||||
// ---------------------------------------
|
// ---------------------------------------
|
||||||
$account = [
|
$account = [
|
||||||
'account_id' => $_POST['account_id'] ?? '',
|
'account_id' => $_SESSION['account_id'] ?? '',
|
||||||
'email' => $_POST['email'] ?? '',
|
'email' => $_POST['email'] ?? '',
|
||||||
'first_name' => $_POST['first_name'] ?? '',
|
'first_name' => $_POST['first_name'] ?? '',
|
||||||
'last_name' => $_POST['last_name'] ?? '',
|
'last_name' => $_POST['last_name'] ?? '',
|
||||||
@@ -58,10 +58,12 @@ if (empty($_SESSION['cart'])) {
|
|||||||
|
|
||||||
// Check if user is logged in
|
// Check if user is logged in
|
||||||
if (isset($_SESSION['account_loggedin'])) {
|
if (isset($_SESSION['account_loggedin'])) {
|
||||||
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE id = ?');
|
$api_url = '/v2/identity/userkey='.$_SESSION['account_id'];
|
||||||
$stmt->execute([ $_SESSION['account_id'] ]);
|
$account = ioAPIv2($api_url,'',$clientsecret);
|
||||||
// Fetch the account from the database and return the result as an Array
|
if (!empty($account)){$account = json_decode($account,true);}
|
||||||
$account = $stmt->fetch(PDO::FETCH_ASSOC);
|
$account = $account[0];
|
||||||
|
//RESET ACCOUNT_ID
|
||||||
|
$account['account_id'] = $account['userkey'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update discount code
|
// Update discount code
|
||||||
@@ -119,14 +121,30 @@ if (isset($_POST['method'], $_POST['first_name'], $_POST['last_name'], $_POST['a
|
|||||||
// If the user is already logged in
|
// If the user is already logged in
|
||||||
if (isset($_SESSION['account_loggedin'])) {
|
if (isset($_SESSION['account_loggedin'])) {
|
||||||
// Account logged-in, update the user's details
|
// Account logged-in, update the user's details
|
||||||
$stmt = $pdo->prepare('UPDATE accounts SET first_name = ?, last_name = ?, address_street = ?, address_city = ?, address_state = ?, address_zip = ?, address_country = ?, address_phone = ? WHERE id = ?');
|
$payload = json_encode(
|
||||||
$stmt->execute([ $_POST['first_name'], $_POST['last_name'], $_POST['address_street'], $_POST['address_city'], $_POST['address_state'], $_POST['address_zip'], $_POST['address_country'], $_POST['address_phone'], $_SESSION['account_id'] ]);
|
array(
|
||||||
$account_id = $_SESSION['account_id'];
|
"language" => $_SESSION['country_code'],
|
||||||
|
"first_name" => $_POST['first_name'],
|
||||||
|
"last_name" => $_POST['last_name'],
|
||||||
|
"address_street" => $_POST['address_street'],
|
||||||
|
"address_city" => $_POST['address_city'],
|
||||||
|
"address_state" => $_POST['address_state'],
|
||||||
|
"address_zip" => $_POST['address_zip'],
|
||||||
|
"address_country" => $_POST['address_country'],
|
||||||
|
"address_phone" => $_POST['address_phone'],
|
||||||
|
"userkey" => $_SESSION['account_id']), JSON_UNESCAPED_UNICODE);
|
||||||
|
$account_update = ioAPIv2('/v2/identity/',$payload,$clientsecret);
|
||||||
|
$account_update = json_decode($account_update,true);
|
||||||
|
$account_id = $account['account_id'] = $_SESSION['account_id'];
|
||||||
|
|
||||||
} else if (isset($_POST['email'], $_POST['password'], $_POST['cpassword']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) && !empty($_POST['password']) && !empty($_POST['cpassword'])) {
|
} else if (isset($_POST['email'], $_POST['password'], $_POST['cpassword']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) && !empty($_POST['password']) && !empty($_POST['cpassword'])) {
|
||||||
// User is not logged in, check if the account already exists with the email they submitted
|
// User is not logged in, check if the account already exists with the email they submitted
|
||||||
$stmt = $pdo->prepare('SELECT id FROM accounts WHERE email = ?');
|
// Check if the account exists
|
||||||
$stmt->execute([ $_POST['email'] ]);
|
$account = ioAPIv2('/v2/identity/email='.$_POST['email'],'',$clientsecret);
|
||||||
if ($stmt->fetch(PDO::FETCH_ASSOC)) {
|
$account = json_decode($account,true);
|
||||||
|
|
||||||
|
|
||||||
|
if ($account) {
|
||||||
// Email exists, user should login instead...
|
// Email exists, user should login instead...
|
||||||
$errors[] = $error_account_name;
|
$errors[] = $error_account_name;
|
||||||
}
|
}
|
||||||
@@ -139,16 +157,33 @@ if (isset($_POST['method'], $_POST['first_name'], $_POST['last_name'], $_POST['a
|
|||||||
$errors[] = $error_account_password_match;
|
$errors[] = $error_account_password_match;
|
||||||
}
|
}
|
||||||
if (!$errors) {
|
if (!$errors) {
|
||||||
// Hash the password
|
// Account doesnt exist, create new account
|
||||||
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
|
$payload = json_encode(
|
||||||
// Email doesnt exist, create new account
|
array(
|
||||||
$stmt = $pdo->prepare('INSERT INTO accounts (email, password, first_name, last_name, address_street, address_city, address_state, address_zip, address_country, address_phone) VALUES (?,?,?,?,?,?,?,?,?,?)');
|
"email" => $_POST['email'],
|
||||||
$stmt->execute([ $_POST['email'], $password, $_POST['first_name'], $_POST['last_name'], $_POST['address_street'], $_POST['address_city'], $_POST['address_state'], $_POST['address_zip'], $_POST['address_country'], $_POST['address_phone'] ]);
|
"password" => $_POST['password'],
|
||||||
$account_id = $pdo->lastInsertId();
|
"language" => $_SESSION['country_code'],
|
||||||
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE id = ?');
|
"first_name" => $_POST['first_name'],
|
||||||
$stmt->execute([ $account_id ]);
|
"last_name" => $_POST['last_name'],
|
||||||
// Fetch the account from the database and return the result as an Array
|
"address_street" => $_POST['address_street'],
|
||||||
$account = $stmt->fetch(PDO::FETCH_ASSOC);
|
"address_city" => $_POST['address_city'],
|
||||||
|
"address_state" => $_POST['address_state'],
|
||||||
|
"address_zip" => $_POST['address_zip'],
|
||||||
|
"address_country" => $_POST['address_country'],
|
||||||
|
"address_phone" => $_POST['address_phone']), JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
|
$account = ioAPIv2('/v2/identity/',$payload,$clientsecret);
|
||||||
|
$account= json_decode($account,true);
|
||||||
|
$account_id = $account['account_id'] = $account['accountID'];
|
||||||
|
|
||||||
|
if ($account && isset($account['accountID'])) {
|
||||||
|
//SEND VERIFICATION EMAIL
|
||||||
|
include dirname(__FILE__).'/custom/email/email_template_register.php';
|
||||||
|
$register_mail = $message;
|
||||||
|
|
||||||
|
send_mail_by_PHPMailer($account['identity'], $subject, $register_mail,'', '');
|
||||||
|
$register_error = 'Email send to verify your account';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (account_required) {
|
} else if (account_required) {
|
||||||
$errors[] = $error_account;
|
$errors[] = $error_account;
|
||||||
@@ -205,7 +240,7 @@ if (isset($_POST['method'], $_POST['first_name'], $_POST['last_name'], $_POST['a
|
|||||||
session_regenerate_id();
|
session_regenerate_id();
|
||||||
$_SESSION['account_loggedin'] = TRUE;
|
$_SESSION['account_loggedin'] = TRUE;
|
||||||
$_SESSION['account_id'] = $account_id;
|
$_SESSION['account_id'] = $account_id;
|
||||||
$_SESSION['account_role'] = $account ? $account['role'] : 'Member';
|
$_SESSION['account_role'] = $account ? $account['profile'] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
@@ -218,10 +253,10 @@ if (isset($_POST['method'], $_POST['first_name'], $_POST['last_name'], $_POST['a
|
|||||||
}
|
}
|
||||||
|
|
||||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
// Mollie = 0 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
// Mollie = 3 ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
if (mollie_enabled && $_POST['method'] == 0) {
|
if (mollie_enabled && $_POST['method'] == 3) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
/*
|
/*
|
||||||
@@ -290,7 +325,7 @@ if (isset($_POST['method'], $_POST['first_name'], $_POST['last_name'], $_POST['a
|
|||||||
// PayPal Payment = 1 +++++++++++++++++++++++++++++++++++++++++
|
// PayPal Payment = 1 +++++++++++++++++++++++++++++++++++++++++
|
||||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
if (paypal_enabled && $_POST['method'] == 'paypal') {
|
if (paypal_enabled && $_POST['method'] == 1) {
|
||||||
|
|
||||||
//Process Payment
|
//Process Payment
|
||||||
require_once __DIR__."/lib/paypal/paypal.php";
|
require_once __DIR__."/lib/paypal/paypal.php";
|
||||||
@@ -356,7 +391,7 @@ $view .= '<p>'.$account_available.' <a href="'.url('index.php?page=myaccount').'
|
|||||||
|
|
||||||
<div class="payment-methods">';
|
<div class="payment-methods">';
|
||||||
if (mollie_enabled){
|
if (mollie_enabled){
|
||||||
$view .= ' <input id="mollie" type="radio" name="method" value="0" '. ((mollie_default)? 'checked':'') .'>
|
$view .= ' <input id="mollie" type="radio" name="method" value="3" '. ((mollie_default)? 'checked':'') .'>
|
||||||
<label for="mollie">
|
<label for="mollie">
|
||||||
<img src="./custom/assets/iDEAL.png" style="width: 50px;" alt="'.$payment_method_1.'">
|
<img src="./custom/assets/iDEAL.png" style="width: 50px;" alt="'.$payment_method_1.'">
|
||||||
<img src="./custom/assets/bancontact.png" style="width: 50px;" alt="'.$payment_method_1.'">
|
<img src="./custom/assets/bancontact.png" style="width: 50px;" alt="'.$payment_method_1.'">
|
||||||
@@ -420,7 +455,7 @@ $view .= '
|
|||||||
|
|
||||||
|
|
||||||
<label for="address_phone">'.$shipping_phone.'</label>
|
<label for="address_phone">'.$shipping_phone.'</label>
|
||||||
<input type="text" value="'.htmlspecialchars($account['address_phone'], ENT_QUOTES).'" name="address_phone" id="address_phone" placeholder="'.$shipping_phone.'" class="form-field" required>
|
<input type="text" value="'.htmlspecialchars(($account['address_phone'] ?? ''), ENT_QUOTES).'" name="address_phone" id="address_phone" placeholder="'.$shipping_phone.'" class="form-field" required>
|
||||||
|
|
||||||
<label for="address_country">'.$shipping_country.'</label>
|
<label for="address_country">'.$shipping_country.'</label>
|
||||||
<select name="address_country" class="ajax-update form-field" required>';
|
<select name="address_country" class="ajax-update form-field" required>';
|
||||||
@@ -462,7 +497,7 @@ $view .= ' </span>
|
|||||||
|
|
||||||
foreach($shipping_methods as $method){
|
foreach($shipping_methods as $method){
|
||||||
$view .= ' <div class="shipping-method">
|
$view .= ' <div class="shipping-method">
|
||||||
<input type="radio" class="ajax-update" id="sm'.$method['id'].'" name="shipping_method" value="'.$method['id'].'" required'.($checkout_input['selected_shipment_method']==$method['id'] ? ' checked':'').'>
|
<input type="radio" class="ajax-update" id="sm'.$method['id'].'" name="shipping_method" value="'.$method['id'].'" required'.(($checkout_input['selected_shipment_method']==$method['id'] || count($shipping_methods) == 1) ? ' checked':'').'>
|
||||||
<label for="sm'.$method['id'].'">'.$method['name'].' ('.currency_code.''.number_format($method['price'], 2).')</label>
|
<label for="sm'.$method['id'].'">'.$method['name'].' ('.currency_code.''.number_format($method['price'], 2).')</label>
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2034,3 +2034,58 @@ input.banner_deny:hover {
|
|||||||
width: 20px;
|
width: 20px;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loading-container {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 9999;
|
||||||
|
opacity: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
transition: opacity 0.3s, visibility 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-container.active {
|
||||||
|
opacity: 1;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-bar {
|
||||||
|
width: 200px;
|
||||||
|
height: 10px;
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
border-radius: 5px;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
height: 100%;
|
||||||
|
width: 0%;
|
||||||
|
background-color: #4CAF50;
|
||||||
|
animation: progressAnimation 2s infinite ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-text {
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes progressAnimation {
|
||||||
|
0% { width: 0%; }
|
||||||
|
50% { width: 100%; }
|
||||||
|
100% { width: 0%; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide the loading bar when page is loaded */
|
||||||
|
.loaded .loading-container {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
@@ -35,7 +35,7 @@ function template_header($title, $head = '') {
|
|||||||
$default_country = isset($_SESSION['country_code']) ? strtolower($_SESSION['country_code']) : language_code;
|
$default_country = isset($_SESSION['country_code']) ? strtolower($_SESSION['country_code']) : language_code;
|
||||||
|
|
||||||
//build up settings
|
//build up settings
|
||||||
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 'Admin' ? '<a href="' . base_url . 'admin/index.php" title="Settings" target="_blank"><i class="fa-solid fa-sliders"></i></a> ': '';
|
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 1 ? '<a href="' . base_url . 'admin/index.php" title="Settings" target="_blank"><i class="fa-solid fa-sliders"></i></a> ': '';
|
||||||
|
|
||||||
//check for age_consent
|
//check for age_consent
|
||||||
if (age_verification_enabled){
|
if (age_verification_enabled){
|
||||||
@@ -69,10 +69,113 @@ if (veliti_analytics){
|
|||||||
<link href="{$base_url}custom/css/style.css" rel="stylesheet" type="text/css">
|
<link href="{$base_url}custom/css/style.css" rel="stylesheet" type="text/css">
|
||||||
<link href="{$base_url}custom/css/custom.css" rel="stylesheet" type="text/css">
|
<link href="{$base_url}custom/css/custom.css" rel="stylesheet" type="text/css">
|
||||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css">
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css">
|
||||||
|
<script>
|
||||||
|
// Wait for DOM to be ready before accessing elements
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
// Get loading screen element
|
||||||
|
const loadingScreen = document.getElementById('loadingScreen');
|
||||||
|
|
||||||
|
// Only proceed if the element exists
|
||||||
|
if (!loadingScreen) {
|
||||||
|
console.error('Loading screen element not found!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show loading screen
|
||||||
|
function showLoading() {
|
||||||
|
loadingScreen.classList.add('active');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide loading screen
|
||||||
|
function hideLoading() {
|
||||||
|
loadingScreen.classList.remove('active');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show loading when page initially loads
|
||||||
|
showLoading();
|
||||||
|
|
||||||
|
// Hide loading when everything is loaded
|
||||||
|
window.addEventListener('load', hideLoading);
|
||||||
|
|
||||||
|
// In case the page loads very quickly
|
||||||
|
setTimeout(hideLoading, 500);
|
||||||
|
|
||||||
|
// Intercept form submissions
|
||||||
|
setupFormInterception();
|
||||||
|
|
||||||
|
// Intercept fetch and XMLHttpRequest
|
||||||
|
interceptNetworkRequests();
|
||||||
|
|
||||||
|
|
||||||
|
// Intercept all form submissions
|
||||||
|
function setupFormInterception() {
|
||||||
|
const forms = document.querySelectorAll('form');
|
||||||
|
|
||||||
|
forms.forEach(form => {
|
||||||
|
form.addEventListener('submit', function(e) {
|
||||||
|
// Show loading screen before form submission
|
||||||
|
showLoading();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Intercept all network requests (fetch and XMLHttpRequest)
|
||||||
|
function interceptNetworkRequests() {
|
||||||
|
// Track active requests
|
||||||
|
let activeRequests = 0;
|
||||||
|
|
||||||
|
// Intercept fetch API
|
||||||
|
const originalFetch = window.fetch;
|
||||||
|
window.fetch = function() {
|
||||||
|
showLoading();
|
||||||
|
activeRequests++;
|
||||||
|
|
||||||
|
return originalFetch.apply(this, arguments)
|
||||||
|
.then(response => {
|
||||||
|
activeRequests--;
|
||||||
|
if (activeRequests === 0) hideLoading();
|
||||||
|
return response;
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
activeRequests--;
|
||||||
|
if (activeRequests === 0) hideLoading();
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// Intercept XMLHttpRequest
|
||||||
|
const originalXHROpen = XMLHttpRequest.prototype.open;
|
||||||
|
const originalXHRSend = XMLHttpRequest.prototype.send;
|
||||||
|
|
||||||
|
XMLHttpRequest.prototype.open = function() {
|
||||||
|
return originalXHROpen.apply(this, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
XMLHttpRequest.prototype.send = function() {
|
||||||
|
showLoading();
|
||||||
|
activeRequests++;
|
||||||
|
|
||||||
|
this.addEventListener('loadend', function() {
|
||||||
|
activeRequests--;
|
||||||
|
if (activeRequests === 0) hideLoading();
|
||||||
|
});
|
||||||
|
|
||||||
|
return originalXHRSend.apply(this, arguments);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
$veliti_analytics
|
$veliti_analytics
|
||||||
$head
|
$head
|
||||||
</head>
|
</head>
|
||||||
<body $style>
|
<body $style>
|
||||||
|
<!-- Loading Bar -->
|
||||||
|
<div class="loading-container" id="loadingScreen">
|
||||||
|
<div class="loading-bar">
|
||||||
|
<div class="progress"></div>
|
||||||
|
</div>
|
||||||
|
<div class="loading-text">Loading, please wait...</div>
|
||||||
|
</div>
|
||||||
<header>
|
<header>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<h1>
|
<h1>
|
||||||
@@ -145,7 +248,7 @@ function template_header_top($title, $head = '') {
|
|||||||
$about_link = url('index.php?page=about');
|
$about_link = url('index.php?page=about');
|
||||||
$myaccount_link = url('index.php?page=myaccount');
|
$myaccount_link = url('index.php?page=myaccount');
|
||||||
$cart_link = url('index.php?page=cart');
|
$cart_link = url('index.php?page=cart');
|
||||||
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 'Admin' ? '<a href="' . base_url . 'admin/index.php" target="_blank">Admin</a>' : '';
|
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 1 ? '<a href="' . base_url . 'admin/index.php" target="_blank">Admin</a>' : '';
|
||||||
$logout_link = isset($_SESSION['account_loggedin']) ? '<a title="Logout" href="' . url('index.php?page=logout') . '"><i class="fas fa-sign-out-alt"></i></a>' : '';
|
$logout_link = isset($_SESSION['account_loggedin']) ? '<a title="Logout" href="' . url('index.php?page=logout') . '"><i class="fas fa-sign-out-alt"></i></a>' : '';
|
||||||
$site_name = site_name;
|
$site_name = site_name;
|
||||||
$site_title = site_title;
|
$site_title = site_title;
|
||||||
@@ -186,10 +289,113 @@ function template_header_top($title, $head = '') {
|
|||||||
<link href="{$base_url}custom/css/style.css" rel="stylesheet" type="text/css">
|
<link href="{$base_url}custom/css/style.css" rel="stylesheet" type="text/css">
|
||||||
<link href="{$base_url}custom/css/custom.css" rel="stylesheet" type="text/css">
|
<link href="{$base_url}custom/css/custom.css" rel="stylesheet" type="text/css">
|
||||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css">
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css">
|
||||||
|
<script>
|
||||||
|
// Wait for DOM to be ready before accessing elements
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
// Get loading screen element
|
||||||
|
const loadingScreen = document.getElementById('loadingScreen');
|
||||||
|
|
||||||
|
// Only proceed if the element exists
|
||||||
|
if (!loadingScreen) {
|
||||||
|
console.error('Loading screen element not found!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show loading screen
|
||||||
|
function showLoading() {
|
||||||
|
loadingScreen.classList.add('active');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide loading screen
|
||||||
|
function hideLoading() {
|
||||||
|
loadingScreen.classList.remove('active');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show loading when page initially loads
|
||||||
|
showLoading();
|
||||||
|
|
||||||
|
// Hide loading when everything is loaded
|
||||||
|
window.addEventListener('load', hideLoading);
|
||||||
|
|
||||||
|
// In case the page loads very quickly
|
||||||
|
setTimeout(hideLoading, 500);
|
||||||
|
|
||||||
|
// Intercept form submissions
|
||||||
|
setupFormInterception();
|
||||||
|
|
||||||
|
// Intercept fetch and XMLHttpRequest
|
||||||
|
interceptNetworkRequests();
|
||||||
|
|
||||||
|
|
||||||
|
// Intercept all form submissions
|
||||||
|
function setupFormInterception() {
|
||||||
|
const forms = document.querySelectorAll('form');
|
||||||
|
|
||||||
|
forms.forEach(form => {
|
||||||
|
form.addEventListener('submit', function(e) {
|
||||||
|
// Show loading screen before form submission
|
||||||
|
showLoading();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Intercept all network requests (fetch and XMLHttpRequest)
|
||||||
|
function interceptNetworkRequests() {
|
||||||
|
// Track active requests
|
||||||
|
let activeRequests = 0;
|
||||||
|
|
||||||
|
// Intercept fetch API
|
||||||
|
const originalFetch = window.fetch;
|
||||||
|
window.fetch = function() {
|
||||||
|
showLoading();
|
||||||
|
activeRequests++;
|
||||||
|
|
||||||
|
return originalFetch.apply(this, arguments)
|
||||||
|
.then(response => {
|
||||||
|
activeRequests--;
|
||||||
|
if (activeRequests === 0) hideLoading();
|
||||||
|
return response;
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
activeRequests--;
|
||||||
|
if (activeRequests === 0) hideLoading();
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// Intercept XMLHttpRequest
|
||||||
|
const originalXHROpen = XMLHttpRequest.prototype.open;
|
||||||
|
const originalXHRSend = XMLHttpRequest.prototype.send;
|
||||||
|
|
||||||
|
XMLHttpRequest.prototype.open = function() {
|
||||||
|
return originalXHROpen.apply(this, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
XMLHttpRequest.prototype.send = function() {
|
||||||
|
showLoading();
|
||||||
|
activeRequests++;
|
||||||
|
|
||||||
|
this.addEventListener('loadend', function() {
|
||||||
|
activeRequests--;
|
||||||
|
if (activeRequests === 0) hideLoading();
|
||||||
|
});
|
||||||
|
|
||||||
|
return originalXHRSend.apply(this, arguments);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
$veliti_analytics
|
$veliti_analytics
|
||||||
$head
|
$head
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<!-- Loading Bar -->
|
||||||
|
<div class="loading-container" id="loadingScreen">
|
||||||
|
<div class="loading-bar">
|
||||||
|
<div class="progress"></div>
|
||||||
|
</div>
|
||||||
|
<div class="loading-text">Loading, please wait...</div>
|
||||||
|
</div>
|
||||||
<main>
|
<main>
|
||||||
$banner
|
$banner
|
||||||
$age_consent
|
$age_consent
|
||||||
@@ -215,7 +421,7 @@ function template_menu(){
|
|||||||
$default_country = isset($_SESSION['country_code']) ? strtolower($_SESSION['country_code']) : language_code;
|
$default_country = isset($_SESSION['country_code']) ? strtolower($_SESSION['country_code']) : language_code;
|
||||||
|
|
||||||
//build up settings
|
//build up settings
|
||||||
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 'Admin' ? '<a href="' . base_url . 'admin/index.php" title="Settings" target="_blank"><i class="fa-solid fa-sliders"></i></a> ': '';
|
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 1 ? '<a href="' . base_url . 'admin/index.php" title="Settings" target="_blank"><i class="fa-solid fa-sliders"></i></a> ': '';
|
||||||
|
|
||||||
|
|
||||||
// DO NOT INDENT THE BELOW CODE
|
// DO NOT INDENT THE BELOW CODE
|
||||||
@@ -346,8 +552,11 @@ function template_footer() {
|
|||||||
// Order email
|
// Order email
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
//Template header order email
|
//Template header order email
|
||||||
function template_order_email_header() {
|
function template_order_email_header($user_language) {
|
||||||
include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
|
|
||||||
|
$user_language = ((isset($_SESSION['country_code']))? $_SESSION['country_code'] :$user_language);
|
||||||
|
|
||||||
|
include './custom/translations/translations_'.strtoupper($user_language).'.php';
|
||||||
|
|
||||||
$home_link = url('index.php');
|
$home_link = url('index.php');
|
||||||
$myaccount_link = url('index.php?page=myaccount');
|
$myaccount_link = url('index.php?page=myaccount');
|
||||||
|
|||||||
@@ -1,16 +1,4 @@
|
|||||||
<?php
|
<?php defined(security_key) or exit;
|
||||||
defined($security_key) or exit;
|
|
||||||
//------------------------------------------
|
|
||||||
// Content Reset Email
|
|
||||||
//------------------------------------------
|
|
||||||
$newuser_subject = 'CustomerPortal user created';
|
|
||||||
$newuser_header = 'Dear CustomerPortal user';
|
|
||||||
|
|
||||||
$newuser_text = 'Your administrator has provided access to the CustomerPortal.';
|
|
||||||
$newuser_credential_text_1 = 'Your account has been created with username ';
|
|
||||||
$newuser_credential_text_2 = 'Please click the button below to complete your registration.';
|
|
||||||
|
|
||||||
$newuser_closure = 'For security reasons this link is only active for 10 minutes.';
|
|
||||||
|
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
// Content Reset Email
|
// Content Reset Email
|
||||||
@@ -44,8 +32,8 @@ $message = '
|
|||||||
<table class="content" width="600" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse; border: 1px solid #cccccc;">
|
<table class="content" width="600" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse; border: 1px solid #cccccc;">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="header" style="background-color:#005655; padding: 40px; text-align: center; color: white; font-size: 24px;">
|
<td class="header" style="background-color:'.color.'; padding: 40px; text-align: center; color: white; font-size: 24px;">
|
||||||
CustomerPortal
|
'.site_title.'
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -55,7 +43,7 @@ $message = '
|
|||||||
'.$newuser_header.',
|
'.$newuser_header.',
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
'.$newuser_text.' '.$newuser_credential_text_1.'<b>'.$post_content['username'].'</b>
|
'.$newuser_text.' '.$newuser_credential_text_1.'<b>'.$account['identity'].'</b>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
'.$newuser_credential_text_2.'
|
'.$newuser_credential_text_2.'
|
||||||
@@ -68,8 +56,8 @@ $message = '
|
|||||||
<!-- CTA Button -->
|
<!-- CTA Button -->
|
||||||
<table cellspacing="0" cellpadding="0" style="margin: auto;">
|
<table cellspacing="0" cellpadding="0" style="margin: auto;">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" style="background-color: #008685; padding: 10px 20px; border-radius: 5px;">
|
<td align="center" style="background-color: '.color_accent.'; padding: 10px 20px; border-radius: 5px;">
|
||||||
<a href="https://' . base_url . '/page=myaccount?activation_key='.$resetkey.'" target="_blank" style="color: #ffffff; text-decoration: none; font-weight: bold;">Reset Password</a>
|
<a href="'.url('index.php?page=myaccount?activation_key='.$account['accountID'].'').'" target="_blank" style="color: #ffffff; text-decoration: none; font-weight: bold;">'.(${$verify_account} ?? 'Verify account').'</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -80,17 +68,17 @@ $message = '
|
|||||||
'.$newuser_closure.'
|
'.$newuser_closure.'
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
Kind regards,
|
'.$newuser_signature.'
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
Service team
|
'.$newuser_signature_name.'
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="footer" style="background: url(\'https://'.base_url.emaillogo.'\');background-position: center center;background-repeat:no-repeat;background-size:contain;background-color: #005655; padding: 40px;">
|
<td class="footer" style="background: url(\'https://'.base_url.emaillogo.'\');background-position: center center;background-repeat:no-repeat;background-size:contain;background-color:'.color.'; padding: 40px;">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,13 +1,4 @@
|
|||||||
<?php
|
<?php defined(security_key) or exit;
|
||||||
defined($security_key) or exit;
|
|
||||||
//------------------------------------------
|
|
||||||
// Content Reset Email
|
|
||||||
//------------------------------------------
|
|
||||||
$changeuser_subject = 'CustomerPortal - password reset requested';
|
|
||||||
$changeuser_header = 'Dear CustomerPortal user';
|
|
||||||
$changeuser_text = 'A password reset has been requested for your account.';
|
|
||||||
$changeuser_credential_text_1 = 'Please click the button below to reset the password of your CustomerPortal account.';
|
|
||||||
$changeuser_closure = 'For security reasons this link is only active for 10 minutes.';
|
|
||||||
|
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
// Content Reset Email
|
// Content Reset Email
|
||||||
@@ -42,7 +33,7 @@ $message = '
|
|||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="header" style="background-color:#005655; padding: 40px; text-align: center; color: white; font-size: 24px;">
|
<td class="header" style="background-color:#005655; padding: 40px; text-align: center; color: white; font-size: 24px;">
|
||||||
CustomerPortal
|
'.site_title.'
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -66,7 +57,7 @@ $message = '
|
|||||||
<table cellspacing="0" cellpadding="0" style="margin: auto;">
|
<table cellspacing="0" cellpadding="0" style="margin: auto;">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" style="background-color: #008685; padding: 10px 20px; border-radius: 5px;">
|
<td align="center" style="background-color: #008685; padding: 10px 20px; border-radius: 5px;">
|
||||||
<a href="https://' . $portalURL . '/reset.php?resetkey='.$resetkey.'" target="_blank" style="color: #ffffff; text-decoration: none; font-weight: bold;">Reset Password</a>
|
<a href="'.url('index.php?page=myaccount?reset_key='.$account['resetkey'].'').'" target="_blank" style="color: #ffffff; text-decoration: none; font-weight: bold;">'.(${$reset_account} ?? 'Reset account').'</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -77,17 +68,17 @@ $message = '
|
|||||||
'.$changeuser_closure.'
|
'.$changeuser_closure.'
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
Kind regards,
|
'.$changeuser_signature.'
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
Service team
|
'.$changeuser_signature_name.'
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="footer" style="background: url(\'https://'.$portalURL.emaillogo.'\');background-position: center center;background-repeat:no-repeat;background-size:contain;background-color: #005655; padding: 40px;">
|
<td class="footer" style="background: url(\'https://'.base_url.emaillogo.'\');background-position: center center;background-repeat:no-repeat;background-size:contain;background-color:'.color.'; padding: 40px;">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php defined(security_key) or exit; ?>
|
<?php defined(security_key) or exit; ?>
|
||||||
|
|
||||||
<?=template_order_email_header()?>
|
<?=template_order_email_header('')?>
|
||||||
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
|
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td><br></td></tr>
|
<tr><td><br></td></tr>
|
||||||
@@ -39,9 +39,17 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach($products['products'] as $product): ?>
|
<?php foreach($products['products'] as $product): ?>
|
||||||
|
<?php
|
||||||
|
if (isset($product['options']) && $product['options'] !=''){
|
||||||
|
$prod_options = '';
|
||||||
|
foreach ($product['options'] as $prod_opt){
|
||||||
|
$prod_options .= (${$prod_opt} ?? $prod_opt).', ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?=${$product['meta']['name']} ?? $product['meta']['name']?></td>
|
<td><?=${$product['meta']['name']} ?? $product['meta']['name']?></td>
|
||||||
<td><?=implode(", ", $product['options'])?></td>
|
<td><?=htmlspecialchars(substr($prod_options, 0,-2), ENT_QUOTES)?></td>
|
||||||
<td><?=$product['quantity']?></td>
|
<td><?=$product['quantity']?></td>
|
||||||
<td><?=currency_code?><?=number_format($product['options_price'],2)?></td>
|
<td><?=currency_code?><?=number_format($product['options_price'],2)?></td>
|
||||||
<td style="text-align:right;"><?=number_format($product['options_price'] * $product['quantity'],2)?></td>
|
<td style="text-align:right;"><?=number_format($product['options_price'] * $product['quantity'],2)?></td>
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
//(defined(security_key) or defined('admin')) or exit; ?>
|
//(defined(security_key) or defined('admin')) or exit; ?>
|
||||||
|
|
||||||
<?=template_order_email_header()?>
|
<?=template_order_email_header($user_language)?>
|
||||||
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
|
<?php include './custom/translations/translations_'.strtoupper($user_language).'.php';?>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td><br></td></tr>
|
<tr><td><br></td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -39,9 +39,18 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
foreach($invoice_cust['products'] as $product): ?>
|
foreach($invoice_cust['products'] as $product): ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if (isset($product['options']) && $product['options'] !=''){
|
||||||
|
$prod_options = '';
|
||||||
|
foreach ($product['options'] as $prod_opt){
|
||||||
|
$prod_options .= (${$prod_opt} ?? $prod_opt).', ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?=${$product['product_name']} ?? $product['product_name'] ?></td>
|
<td><?=${$product['product_name']} ?? $product['product_name'] ?></td>
|
||||||
<td><?=implode(", ", $product['options'])?></td>
|
<td><?=htmlspecialchars(substr($prod_options, 0,-2), ENT_QUOTES)?></td>
|
||||||
<td><?=$product['quantity']?></td>
|
<td><?=$product['quantity']?></td>
|
||||||
<td><?=currency_code?> <?=number_format($product['price'],2)?></td>
|
<td><?=currency_code?> <?=number_format($product['price'],2)?></td>
|
||||||
<td style="text-align:right;"><?=currency_code?> <?=number_format($product['line_total'],2)?></td>
|
<td style="text-align:right;"><?=currency_code?> <?=number_format($product['line_total'],2)?></td>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php defined(security_key) or exit; ?>
|
<?php defined(security_key) or exit; ?>
|
||||||
|
|
||||||
<?=template_order_email_header()?>
|
<?=template_order_email_header('')?>
|
||||||
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
|
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
<h1><?=$order_email_message_1?></h1>
|
<h1><?=$order_email_message_1?></h1>
|
||||||
<p><?=$order_email_message_2?></p></td>
|
<p><?=$order_email_message_2?></p></td>
|
||||||
<td>
|
<td>
|
||||||
<p>Order: <?=$order_id?></p>
|
<p><?=$order_invoice_text ?? 'Invoice'?>: <?=$order_id?></p>
|
||||||
<p>Date: <?php echo date("Y-m-d");?></p></td>
|
<p><?=$order_date_text ?? 'Date'?>: <?php echo date("Y-m-d");?></p></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -40,9 +40,17 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach($products['products'] as $product): ?>
|
<?php foreach($products['products'] as $product): ?>
|
||||||
|
<?php
|
||||||
|
if (isset($product['options']) && $product['options'] !=''){
|
||||||
|
$prod_options = '';
|
||||||
|
foreach ($product['options'] as $prod_opt){
|
||||||
|
$prod_options .= (${$prod_opt} ?? $prod_opt).', ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?=${$product['product_name']} ?? $product['product_name']?></td>
|
<td><?=${$product['product_name']} ?? $product['product_name']?></td>
|
||||||
<td><?=implode(", ", $product['options'])?></td>
|
<td><?=htmlspecialchars(substr($prod_options, 0,-2), ENT_QUOTES)?></td>
|
||||||
<td><?=$product['quantity']?></td>
|
<td><?=$product['quantity']?></td>
|
||||||
<td><?=currency_code?><?=number_format($product['options_price'],2)?></td>
|
<td><?=currency_code?><?=number_format($product['options_price'],2)?></td>
|
||||||
<td style="text-align:right;"><?=number_format($product['options_price'] * $product['quantity'],2)?></td>
|
<td style="text-align:right;"><?=number_format($product['options_price'] * $product['quantity'],2)?></td>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ define('age_verification_enabled',false);
|
|||||||
define('veliti_analytics',false);
|
define('veliti_analytics',false);
|
||||||
// Default logtraffic
|
// Default logtraffic
|
||||||
define('log_usage',false);
|
define('log_usage',false);
|
||||||
|
|
||||||
/* Banners */
|
/* Banners */
|
||||||
// Show offer at home page
|
// Show offer at home page
|
||||||
define('show_offer_home_page',true);
|
define('show_offer_home_page',true);
|
||||||
@@ -24,7 +25,6 @@ define('show_offer_home_text','Free shipping on all of our watches');
|
|||||||
// Show offer at products page
|
// Show offer at products page
|
||||||
define('show_offer_product_page',true);
|
define('show_offer_product_page',true);
|
||||||
define('show_offer_product_text','Free shipping on all of our watches');
|
define('show_offer_product_text','Free shipping on all of our watches');
|
||||||
|
|
||||||
//Banner at site entry
|
//Banner at site entry
|
||||||
define('banner_enabled',false);
|
define('banner_enabled',false);
|
||||||
define('banner_wow','Introduction offer');
|
define('banner_wow','Introduction offer');
|
||||||
@@ -33,6 +33,14 @@ define('banner_link','https://www.kickstarter.com/projects/morvalwatches/morval-
|
|||||||
define('banner_btn_1','Continue@Kickstarter');
|
define('banner_btn_1','Continue@Kickstarter');
|
||||||
define('banner_btn_2','Stay@MorvalWatches');
|
define('banner_btn_2','Stay@MorvalWatches');
|
||||||
|
|
||||||
|
/*Appearance*/
|
||||||
|
//Icon
|
||||||
|
define('icon_image','custom/assets/MORVALFavicon.svg');
|
||||||
|
define('color','#005655c2');
|
||||||
|
define('color_accent','#2FAC66');
|
||||||
|
//EMAIL LOGO
|
||||||
|
define('emaillogo','custom/assets/MORVALFavicon.svg');
|
||||||
|
|
||||||
/* Detailed settings */
|
/* Detailed settings */
|
||||||
// Homepage highlightedproducts
|
// Homepage highlightedproducts
|
||||||
define('category_id_highlighted_products_1','6');
|
define('category_id_highlighted_products_1','6');
|
||||||
@@ -93,8 +101,6 @@ define('about_morval_image_1','custom/assets/morval_about_morval_monument_detail
|
|||||||
define('about_morval_image_2','custom/assets/morval_about_morval_bordje.png');
|
define('about_morval_image_2','custom/assets/morval_about_morval_bordje.png');
|
||||||
// ABOUT MORVAL image 3
|
// ABOUT MORVAL image 3
|
||||||
define('about_morval_image_3','custom/assets/morval_about_morval_monument_overzicht.png');
|
define('about_morval_image_3','custom/assets/morval_about_morval_monument_overzicht.png');
|
||||||
//Icon
|
|
||||||
define('icon_image','custom/assets/MORVALFavicon.svg');
|
|
||||||
//Banner
|
//Banner
|
||||||
define('banner_background','custom/assets/morval_banner.jpg');
|
define('banner_background','custom/assets/morval_banner.jpg');
|
||||||
|
|
||||||
@@ -133,8 +139,6 @@ define('mail_enabled',true);
|
|||||||
define('email','info@gewoonlekkerspaans.nl');
|
define('email','info@gewoonlekkerspaans.nl');
|
||||||
// Receive email notifications?
|
// Receive email notifications?
|
||||||
define('email_notifications',false);
|
define('email_notifications',false);
|
||||||
//EMAIL LOGO
|
|
||||||
define('emaillogo','custom/assets/MORVALFavicon.svg');
|
|
||||||
//Additional phpmailer-settings
|
//Additional phpmailer-settings
|
||||||
define('email_host_name','gewoonlekkerspaans.nl');
|
define('email_host_name','gewoonlekkerspaans.nl');
|
||||||
define('email_reply_to','info@gewoonlekkerspaans.nl');
|
define('email_reply_to','info@gewoonlekkerspaans.nl');
|
||||||
@@ -152,10 +156,10 @@ define('db_pass','4~gv71bM6');
|
|||||||
// Database name
|
// Database name
|
||||||
define('db_name','shoppingcart_advanced'); //morvalwatches
|
define('db_name','shoppingcart_advanced'); //morvalwatches
|
||||||
/* API */
|
/* API */
|
||||||
define('clientID','paul@veliti.nl'); //morvalwatches
|
define('clientID','MorvalWatches'); //morvalwatches
|
||||||
define('clientsecret','test1234'); //morvalwatches
|
define('clientsecret','MW2024!'); //morvalwatches
|
||||||
define('api_url','https://dev.veliti.nl/api.php'); //morvalwatches
|
define('api_url','https://dev.veliti.nl/api.php'); //morvalwatches
|
||||||
define('img_url',substr(api_url, 0, -8));
|
define('img_url','https://dev.veliti.nl/');
|
||||||
|
|
||||||
/* Payment options */
|
/* Payment options */
|
||||||
//Pay on Delivery
|
//Pay on Delivery
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ function send_order_details_email($email, $products, $first_name, $last_name, $a
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$subject = $subject_new_order;
|
$subject = $subject_new_order;
|
||||||
$headers = 'From: ' . mail_from . "\r\n" . 'Reply-To: ' . mail_from . "\r\n" . 'Return-Path: ' . mail_from . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-Type: text/html; charset=UTF-8' . "\r\n";
|
//$headers = 'From: ' . mail_from . "\r\n" . 'Reply-To: ' . mail_from . "\r\n" . 'Return-Path: ' . mail_from . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-Type: text/html; charset=UTF-8' . "\r\n";
|
||||||
ob_start();
|
ob_start();
|
||||||
include './custom/email/order-details-template.php';
|
include './custom/email/order-details-template.php';
|
||||||
$order_details_template = ob_get_clean();
|
$order_details_template = ob_get_clean();
|
||||||
@@ -163,7 +163,7 @@ function send_product_notification_email($email,$product_details){
|
|||||||
include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
|
include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
|
||||||
|
|
||||||
$subject = $subject_out_of_stock.' - '.$product_details;
|
$subject = $subject_out_of_stock.' - '.$product_details;
|
||||||
$headers = 'From: ' . mail_from . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'Return-Path: ' . mail_from . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-Type: text/html; charset=UTF-8' . "\r\n";
|
//$headers = 'From: ' . mail_from . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'Return-Path: ' . mail_from . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-Type: text/html; charset=UTF-8' . "\r\n";
|
||||||
|
|
||||||
$message = $product_details.' are out of stock. Please notify '.$email.' when available';
|
$message = $product_details.' are out of stock. Please notify '.$email.' when available';
|
||||||
//mail(email, $subject, $message, $headers);
|
//mail(email, $subject, $message, $headers);
|
||||||
@@ -472,10 +472,10 @@ function removeGiftCart($pdo, $orderID){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateInvoice($invoice,$orderID){
|
function generateInvoice($invoice_cust,$orderID,$user_language){
|
||||||
|
|
||||||
//Variables
|
//Variables
|
||||||
$customer_email = htmlspecialchars($invoice['customer']['email'] ?? '', ENT_QUOTES);
|
$customer_email = htmlspecialchars($invoice_cust['customer']['email'] ?? '', ENT_QUOTES);
|
||||||
//Generate invoice
|
//Generate invoice
|
||||||
ob_start();
|
ob_start();
|
||||||
include dirname(__FILE__).'/custom/email/order-invoice-template.php';
|
include dirname(__FILE__).'/custom/email/order-invoice-template.php';
|
||||||
|
|||||||
2
home.php
@@ -29,7 +29,7 @@ $view = '
|
|||||||
if(show_offer_home_page){
|
if(show_offer_home_page){
|
||||||
$view .='
|
$view .='
|
||||||
<div class="" style="text-align: center;">
|
<div class="" style="text-align: center;">
|
||||||
<p class="p.paragraph.neutral-paragraph-text-1" style="font-family:\'gerb\';font-size: 15px;">'.${show_offer_home_text} ?? show_offer_home_text .'</p>
|
<p class="p.paragraph.neutral-paragraph-text-1" style="font-family:\'gerb\';font-size: 15px;">'.(${show_offer_home_text} ?? show_offer_home_text).'</p>
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
$view .='
|
$view .='
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ $url = routes([
|
|||||||
'/products/{category}/{sort}' => 'products.php',
|
'/products/{category}/{sort}' => 'products.php',
|
||||||
'/products/{p}/{category}/{sort}' => 'products.php',
|
'/products/{p}/{category}/{sort}' => 'products.php',
|
||||||
'/myaccount' => 'myaccount.php',
|
'/myaccount' => 'myaccount.php',
|
||||||
|
'/myaccount/{activation_key}' => 'myaccount.php',
|
||||||
'/myaccount/{tab}' => 'myaccount.php',
|
'/myaccount/{tab}' => 'myaccount.php',
|
||||||
'/download/{id}' => 'download.php',
|
'/download/{id}' => 'download.php',
|
||||||
'/cart' => 'cart.php',
|
'/cart' => 'cart.php',
|
||||||
|
|||||||
409
myaccount.php
@@ -1,6 +1,46 @@
|
|||||||
<?php
|
<?php
|
||||||
// Prevent direct access to file
|
// Prevent direct access to file
|
||||||
defined(security_key) or exit;
|
defined(security_key) or exit;
|
||||||
|
|
||||||
|
if (isset($_GET['activation_key']) && strlen($_GET['activation_key']) == 50){
|
||||||
|
//ACTIVATION KEY IS PROVIDED
|
||||||
|
//1. CHECK IF KEY EXISTS AND ISVERIFIED = 0 (not verified)
|
||||||
|
$account = ioAPIv2('/v2/identity/userkey='.$_GET['activation_key'].'&isverified=0','',$clientsecret);
|
||||||
|
$account = json_decode($account,true);
|
||||||
|
|
||||||
|
//ACCOUNT EXISTS NOT VERIFIED
|
||||||
|
if ($account){
|
||||||
|
$payload = json_encode(array("userkey" => $_GET['activation_key'], "isverified" => 1), JSON_UNESCAPED_UNICODE);
|
||||||
|
$verified = ioAPIv2('/v2/identity/',$payload,$clientsecret);
|
||||||
|
$verified = json_decode($verified,true);
|
||||||
|
|
||||||
|
if($verified['status'] == 'updated'){
|
||||||
|
//USER VERIFIED => LOGIN
|
||||||
|
session_regenerate_id();
|
||||||
|
$_SESSION['account_loggedin'] = TRUE;
|
||||||
|
$_SESSION['account_id'] = $verified['accountID'];
|
||||||
|
$_SESSION['account_role'] = $account['profile'];
|
||||||
|
$_SESSION['country_code'] = $account['language'];
|
||||||
|
|
||||||
|
$products_in_cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : [];
|
||||||
|
|
||||||
|
if ($products_in_cart) {
|
||||||
|
// user has products in cart, redirect them to the checkout page
|
||||||
|
header('Location: ' . url('index.php?page=checkout'));
|
||||||
|
} else {
|
||||||
|
// Redirect the user back to the same page, they can then see their order history
|
||||||
|
header('Location: ' . url('index.php?page=myaccount'));
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
$error = $error_myaccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$error = $error_myaccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
// User clicked the "Login" button, proceed with the login process... check POST data and validate email
|
// User clicked the "Login" button, proceed with the login process... check POST data and validate email
|
||||||
if (isset($_POST['login'], $_POST['email'], $_POST['password']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
|
if (isset($_POST['login'], $_POST['email'], $_POST['password']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
|
||||||
|
|
||||||
@@ -17,6 +57,7 @@ if (isset($_POST['login'], $_POST['email'], $_POST['password']) && filter_var($_
|
|||||||
$_SESSION['account_loggedin'] = TRUE;
|
$_SESSION['account_loggedin'] = TRUE;
|
||||||
$_SESSION['account_id'] = $account['accountID'];
|
$_SESSION['account_id'] = $account['accountID'];
|
||||||
$_SESSION['account_role'] = $account['profile'];
|
$_SESSION['account_role'] = $account['profile'];
|
||||||
|
$_SESSION['country_code'] = $account['language'];
|
||||||
$products_in_cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : [];
|
$products_in_cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : [];
|
||||||
|
|
||||||
if ($products_in_cart) {
|
if ($products_in_cart) {
|
||||||
@@ -36,76 +77,62 @@ $register_error = '';
|
|||||||
// User clicked the "Register" button, proceed with the registration process... check POST data and validate email
|
// User clicked the "Register" button, proceed with the registration process... check POST data and validate email
|
||||||
if (isset($_POST['register'], $_POST['email'], $_POST['password'], $_POST['cpassword']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
|
if (isset($_POST['register'], $_POST['email'], $_POST['password'], $_POST['cpassword']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
|
||||||
// Check if the account exists
|
// Check if the account exists
|
||||||
|
|
||||||
$account = ioAPIv2('/v2/identity/email='.$_POST['email'],'',$clientsecret);
|
$account = ioAPIv2('/v2/identity/email='.$_POST['email'],'',$clientsecret);
|
||||||
$account = json_decode($account,true);
|
$account = json_decode($account,true);
|
||||||
|
|
||||||
if ($account) {
|
if ($account) {
|
||||||
// Account exists!
|
// Account exists!
|
||||||
$register_error = $error_myaccount_exists;
|
$register_error = 'Account already exists';
|
||||||
;
|
;
|
||||||
} else if ($_POST['cpassword'] != $_POST['password']) {
|
} else if ($_POST['cpassword'] != $_POST['password']) {
|
||||||
$register_error = 'Passwords do not match!';
|
$register_error = 'Passwords do not match!';
|
||||||
} else if (strlen($_POST['password']) > 20 || strlen($_POST['password']) < 5) {
|
} else if (strlen($_POST['password']) > 20 || strlen($_POST['password']) < 5) {
|
||||||
// Password must be between 5 and 20 characters long.
|
// Password must be between 5 and 20 characters long.
|
||||||
$register_error = $error_account_password_rules;
|
$register_error = 'Password must be between 5 and 20 characters long';
|
||||||
} else {
|
} else {
|
||||||
// Account doesnt exist, create new account
|
// Account doesnt exist, create new account
|
||||||
$payload = json_encode(array("login" => "consumer", "email" => $_POST['email'], "password" => $_POST['password'], "language" => $_SESSION['country_code']), JSON_UNESCAPED_UNICODE);
|
$payload = json_encode(array("email" => $_POST['email'], "password" => $_POST['password'], "language" => $_SESSION['country_code']), JSON_UNESCAPED_UNICODE);
|
||||||
$account = ioAPIv2('/v2/identity/',$payload,$clientsecret);
|
$account = ioAPIv2('/v2/identity/',$payload,$clientsecret);
|
||||||
$account= json_decode($account,true);
|
$account= json_decode($account,true);
|
||||||
|
|
||||||
if ($account && isset($account['accountID'])) {
|
if ($account && isset($account['accountID'])) {
|
||||||
//SEND VERIFICATION EMAIL
|
//SEND VERIFICATION EMAIL
|
||||||
ob_start();
|
|
||||||
include dirname(__FILE__).'/custom/email/email_template_register.php';
|
include dirname(__FILE__).'/custom/email/email_template_register.php';
|
||||||
$register_mail= ob_get_clean();
|
$register_mail = $message;
|
||||||
|
|
||||||
send_mail_by_PHPMailer($_POST['email'], $subject, $register_mail,'', '');
|
send_mail_by_PHPMailer($account['identity'], $subject, $register_mail,'', '');
|
||||||
exit;
|
$register_error = 'Email send to verify your account';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine the current tab page
|
// Determine the current tab page
|
||||||
$tab = isset($_GET['tab']) ? $_GET['tab'] : 'orders';
|
$tab = (isset($_GET['activation_key']) && strlen($_GET['activation_key']) != 50 ) ? $_GET['activation_key'] : 'orders';
|
||||||
|
|
||||||
// If user is logged in
|
// If user is logged in
|
||||||
if (isset($_SESSION['account_loggedin'])) {
|
if (isset($_SESSION['account_loggedin'])) {
|
||||||
// Select all the users transations, which will appear under "My Orders"
|
|
||||||
$stmt = $pdo->prepare('SELECT * FROM transactions WHERE account_id = ? ORDER BY created DESC');
|
//CALL TO API
|
||||||
$stmt->execute([ $_SESSION['account_id'] ]);
|
$api_url = '/v2/transactions_items/account_id='.$_SESSION['account_id'];
|
||||||
$transactions = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$orders = ioAPIv2($api_url,'',$clientsecret);
|
||||||
// Select all the users transations, which will appear under "My Orders"
|
//Decode Payload
|
||||||
$stmt = $pdo->prepare('SELECT
|
if (!empty($orders)){$orders = json_decode($orders,true);}else{$orders = null;}
|
||||||
p.name,
|
|
||||||
p.id AS product_id,
|
|
||||||
t.txn_id,
|
|
||||||
t.payment_status,
|
|
||||||
t.created AS transaction_date,
|
|
||||||
ti.item_price AS price,
|
|
||||||
ti.item_quantity AS quantity,
|
|
||||||
ti.item_id,
|
|
||||||
(SELECT m.full_path FROM products_media pm JOIN media m ON m.id = pm.media_id WHERE pm.product_id = p.id ORDER BY pm.position ASC LIMIT 1) AS img
|
|
||||||
FROM transactions t
|
|
||||||
JOIN transactions_items ti ON ti.txn_id = t.txn_id
|
|
||||||
JOIN accounts a ON a.id = t.account_id
|
|
||||||
JOIN products p ON p.id = ti.item_id
|
|
||||||
WHERE t.account_id = ?
|
|
||||||
ORDER BY t.created DESC');
|
|
||||||
$stmt->execute([ $_SESSION['account_id'] ]);
|
|
||||||
$transactions_items = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
||||||
// Retrieve the digital downloads
|
|
||||||
$transactions_ids = array_column($transactions_items, 'product_id');
|
|
||||||
if ($transactions_ids) {
|
|
||||||
$stmt = $pdo->prepare('SELECT product_id, file_path, id FROM products_downloads WHERE product_id IN (' . trim(str_repeat('?,',count($transactions_ids)),',') . ') ORDER BY position ASC');
|
|
||||||
$stmt->execute($transactions_ids);
|
|
||||||
$downloads = $stmt->fetchAll(PDO::FETCH_GROUP);
|
|
||||||
} else {
|
|
||||||
$downloads = [];
|
|
||||||
}
|
|
||||||
// Retrieve account details
|
// Retrieve account details
|
||||||
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE id = ?');
|
$api_url = '/v2/identity/userkey='.$_SESSION['account_id'];
|
||||||
$stmt->execute([ $_SESSION['account_id'] ]);
|
$identity = ioAPIv2($api_url,'',$clientsecret);
|
||||||
$account = $stmt->fetch(PDO::FETCH_ASSOC);
|
//Decode Payload
|
||||||
|
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
|
// Update settings
|
||||||
if (isset($_POST['save_details'], $_POST['email'], $_POST['password'])) {
|
if (isset($_POST['save_details'], $_POST['email'], $_POST['password'])) {
|
||||||
// Assign and validate input data
|
// Assign and validate input data
|
||||||
@@ -117,235 +144,231 @@ if (isset($_SESSION['account_loggedin'])) {
|
|||||||
$address_zip = isset($_POST['address_zip']) ? $_POST['address_zip'] : '';
|
$address_zip = isset($_POST['address_zip']) ? $_POST['address_zip'] : '';
|
||||||
$address_country = isset($_POST['address_country']) ? $_POST['address_country'] : '';
|
$address_country = isset($_POST['address_country']) ? $_POST['address_country'] : '';
|
||||||
$address_phone = isset($_POST['address_phone']) ? $_POST['address_phone'] : '';
|
$address_phone = isset($_POST['address_phone']) ? $_POST['address_phone'] : '';
|
||||||
|
|
||||||
// Check if account exists with captured email
|
// Check if account exists with captured email
|
||||||
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE email = ?');
|
if ($_POST['email'] != $identity['email']) {
|
||||||
$stmt->execute([ $_POST['email'] ]);
|
// Check if the account exists
|
||||||
// Validation
|
$account = ioAPIv2('/v2/identity/email='.$_POST['email'],'',$clientsecret);
|
||||||
if ($_POST['email'] != $account['email'] && $stmt->fetch(PDO::FETCH_ASSOC)) {
|
$account = json_decode($account,true);
|
||||||
$error = 'Account already exists with that email!';
|
|
||||||
} else if ($_POST['password'] && (strlen($_POST['password']) > 20 || strlen($_POST['password']) < 5)) {
|
if ($account) {
|
||||||
$error = 'Password must be between 5 and 20 characters long!';
|
// Account exists with change email
|
||||||
} else {
|
$error = $error_myaccount_exists;
|
||||||
// Update account details in database
|
}
|
||||||
$password = $_POST['password'] ? password_hash($_POST['password'], PASSWORD_DEFAULT) : $account['password'];
|
}
|
||||||
$stmt = $pdo->prepare('UPDATE accounts SET email = ?, password = ?, first_name = ?, last_name = ?, address_street = ?, address_city = ?, address_state = ?, address_zip = ?, address_country = ?, address_phone = ? WHERE id = ?');
|
elseif (strlen($_POST['password']) > 20 || strlen($_POST['password']) < 5) {
|
||||||
$stmt->execute([ $_POST['email'], $password, $first_name, $last_name, $address_street, $address_city, $address_state, $address_zip, $address_country, $address_phone, $_SESSION['account_id'] ]);
|
// Password must be between 5 and 20 characters long.
|
||||||
|
$error = $error_account_password_rules;
|
||||||
|
}
|
||||||
|
elseif (!$error){
|
||||||
|
//UPDATE DATA
|
||||||
|
$payload = json_encode(array(
|
||||||
|
"email" => $_POST['email'],
|
||||||
|
"first_name" => $first_name,
|
||||||
|
"last_name" => $last_name,
|
||||||
|
"address_street" => $address_street,
|
||||||
|
"address_city" => $address_city,
|
||||||
|
"address_state" => $address_state,
|
||||||
|
"address_zip" => $address_zip,
|
||||||
|
"address_country" => $address_country,
|
||||||
|
"address_phone" => $address_phone,
|
||||||
|
"password" => $_POST['password'],
|
||||||
|
"language" => $_SESSION['country_code'],
|
||||||
|
"userkey" => $_SESSION['account_id']), JSON_UNESCAPED_UNICODE);
|
||||||
|
$update_identity = ioAPIv2('/v2/identity/',$payload,$clientsecret);
|
||||||
|
$update_identity = json_decode($update_identity,true);
|
||||||
// Redirect to settings page
|
// Redirect to settings page
|
||||||
header('Location: ' . url('index.php?page=myaccount&tab=settings'));
|
header('Location: ' . url('index.php?page=myaccount&tab=settings'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<?=template_header($myaccount_text)?>
|
|
||||||
|
|
||||||
<div class="myaccount content-wrapper">
|
template_header($myaccount_text);
|
||||||
|
|
||||||
<?php if (!isset($_SESSION['account_loggedin'])): ?>
|
$view = '
|
||||||
|
|
||||||
<div class="login-register">
|
<div class="myaccount content-wrapper">';
|
||||||
|
|
||||||
|
if(!isset($_SESSION['account_loggedin'])){
|
||||||
|
|
||||||
|
$view .= '<div class="login-register">
|
||||||
|
|
||||||
<div class="login">
|
<div class="login">
|
||||||
|
|
||||||
<h1><?=$h1_login?></h1>
|
<h1>'.$h1_login.'</h1>
|
||||||
|
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
|
|
||||||
<label for="email" class="form-label"><?=$account_create_email?></label>
|
<label for="email" class="form-label">'.$account_create_email.'</label>
|
||||||
<input type="email" name="email" id="email" placeholder="john@example.com" required class="form-field">
|
<input type="email" name="email" id="email" placeholder="john@example.com" required class="form-field">
|
||||||
|
|
||||||
<label for="password" class="form-label"><?=$account_create_password?></label>
|
<label for="password" class="form-label">'.$account_create_password.'</label>
|
||||||
<input type="password" name="password" id="password" placeholder="<?=$account_create_password?>" required class="form-field">
|
<input type="password" name="password" id="password" placeholder="'.$account_create_password.'" required class="form-field">
|
||||||
|
|
||||||
<input name="login" type="submit" value="<?=$h1_login?>" class="btn">
|
<input name="login" type="submit" value="'.$h1_login.'" class="btn">
|
||||||
|
|
||||||
</form>
|
</form>';
|
||||||
|
|
||||||
<?php if ($error): ?>
|
if($error){
|
||||||
<p class="error"><?=$error?></p>
|
$view .= '<p class="error">'.$error.'</p>';
|
||||||
<?php endif; ?>
|
}
|
||||||
|
|
||||||
</div>
|
$view .= '</div>
|
||||||
|
|
||||||
<div class="register">
|
<div class="register">
|
||||||
|
|
||||||
<h1><?=$h1_register?></h1>
|
<h1>'.$h1_register.'</h1>
|
||||||
|
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
|
|
||||||
<label for="email" class="form-label"><?=$account_create_email?></label>
|
<label for="email" class="form-label">'.$account_create_email.'</label>
|
||||||
<input type="email" name="email" id="email" placeholder="john@example.com" required class="form-field">
|
<input type="email" name="email" id="email" placeholder="john@example.com" required class="form-field">
|
||||||
|
|
||||||
<label for="password" class="form-label"><?=$account_create_password?></label>
|
<label for="password" class="form-label">'.$account_create_password.'</label>
|
||||||
<input type="password" name="password" id="password" placeholder="<?=$account_create_password?>" required class="form-field">
|
<input type="password" name="password" id="password" placeholder="'.$account_create_password.'" required class="form-field">
|
||||||
|
|
||||||
<label for="cpassword" class="form-label"><?=$account_create_password_confirm?></label>
|
<label for="cpassword" class="form-label">'.$account_create_password_confirm.'</label>
|
||||||
<input type="password" name="cpassword" id="cpassword" placeholder="<?=$account_create_password_confirm?>" required class="form-field">
|
<input type="password" name="cpassword" id="cpassword" placeholder="'.$account_create_password_confirm.'" required class="form-field">
|
||||||
|
|
||||||
<input name="register" type="submit" value="<?=$h1_register?>" class="btn">
|
<input name="register" type="submit" value="'.$h1_register.'" class="btn">
|
||||||
|
|
||||||
</form>
|
</form>';
|
||||||
|
|
||||||
<?php if ($register_error): ?>
|
if($register_error){
|
||||||
<p class="error"><?=$register_error?></p>
|
$view .= '<p class="error">'.$register_error.'</p>';
|
||||||
<?php endif; ?>
|
}
|
||||||
|
|
||||||
</div>
|
$view .= ' </div>
|
||||||
|
|
||||||
</div>
|
</div>';
|
||||||
|
|
||||||
<?php else: ?>
|
//++++++++++++++++++++++++++++++++++++++++
|
||||||
|
//MY ACCOUNT DETAILS
|
||||||
|
//++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
<h1><?=$h1_myaccount?></h1>
|
} else {
|
||||||
|
|
||||||
|
$view .= '<h1>'.$h1_myaccount.'</h1>
|
||||||
|
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
|
|
||||||
<h2><?=$h2_menu?></h2>
|
<h2>'.$h2_menu.'</h2>
|
||||||
|
|
||||||
<div class="menu-items">
|
<div class="menu-items">
|
||||||
<a href="<?=url('index.php?page=myaccount')?>"><?=$menu_orders?></a>
|
<a href="'.url('index.php?page=myaccount').'">'.$menu_orders.'</a>
|
||||||
<a href="<?=url('index.php?page=myaccount&tab=downloads')?>"><?=$menu_downloads?></a>
|
<a href="'.url('index.php?page=myaccount&tab=settings').'">'.$menu_settings.'</a>
|
||||||
<a href="<?=url('index.php?page=myaccount&tab=settings')?>"><?=$menu_settings?></a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>';
|
||||||
|
|
||||||
<?php if ($tab == 'orders'): ?>
|
if($tab == 'orders'){
|
||||||
<div class="myorders">
|
$view .= '<div class="myorders">
|
||||||
|
|
||||||
<h2><?=$h2_myorders?></h2>
|
<h2>'.$h2_myorders.'</h2>';
|
||||||
|
|
||||||
<?php if (empty($transactions)): ?>
|
if(empty($orders)){
|
||||||
<p><?=$myorders_message?></p>
|
$view .= '<p>'.$myorders_message.'</p>';
|
||||||
<?php endif; ?>
|
}
|
||||||
<?php foreach ($transactions as $transaction): ?>
|
|
||||||
<div class="order">
|
foreach($orders as $order){
|
||||||
|
|
||||||
|
//Translate status INT to STR
|
||||||
|
$payment_status = 'payment_status_'.$order['header']['payment_status'];
|
||||||
|
|
||||||
|
$view .= '<div class="order">
|
||||||
<div class="order-header">
|
<div class="order-header">
|
||||||
<div>
|
<div>
|
||||||
<div><span><?=$myorders_order?></span># <?=$transaction['id']?></div>
|
<div><span>'.$myorders_order.'</span># '.$order['header']['id'].'</div>
|
||||||
<div class="rhide"><span><?=$myorders_date?></span><?=date('F j, Y', strtotime($transaction['created']))?></div>
|
<div class="rhide"><span>'.$myorders_date.'</span>'.date('F j, Y', strtotime($order['header']['created'])).'</div>
|
||||||
<div><span><?=$myorders_status?></span><?=$transaction['payment_status']?></div>
|
<div><span>'.$myorders_status.'</span>'.(${$payment_status} ?? $order['header']['payment_status']).'</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="rhide"><span><?=$myorders_shipping?></span><?=currency_code?><?=number_format($transaction['shipping_amount'],2)?></div>
|
<div class="rhide"><span>'.$myorders_shipping.'</span>'.currency_code.''.number_format($order['header']['shipping_amount'],2).'</div>
|
||||||
<div><span><?=$myorders_total?></span><?=currency_code?><?=number_format($transaction['payment_amount'],2)?></div>
|
<div><span>'.$myorders_total.'</span>'.currency_code.''.number_format($order['header']['payment_amount'],2).'</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="order-items">
|
<div class="order-items">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>';
|
||||||
<?php foreach ($transactions_items as $transaction_item): ?>
|
foreach($order['items'] as $transaction_item){
|
||||||
<?php if ($transaction_item['txn_id'] != $transaction['txn_id']) continue; ?>
|
$view .= '<tr>
|
||||||
<tr>
|
<td class="img">';
|
||||||
<td class="img">
|
if(!empty($transaction_item['full_path'])){
|
||||||
<?php if (!empty($transaction_item['img']) && file_exists($transaction_item['img'])): ?>
|
$view .= '<img src="'.img_url.''.$transaction_item['full_path'].'" width="50" height="50" alt="'.(${$transaction_item['item_name']} ?? $transaction_item['item_name']).'">';
|
||||||
<img src="<?=base_url?><?=$transaction_item['img']?>" width="50" height="50" alt="<?=$transaction_item['name']?>">
|
}
|
||||||
<?php endif; ?>
|
$view .= '</td>
|
||||||
</td>
|
<td class="name">'.$transaction_item['item_quantity'].' x '.(${$transaction_item['item_name']} ?? $transaction_item['item_name']).'</td>
|
||||||
<td class="name"><?=$transaction_item['quantity']?> x <?=$transaction_item['name']?></td>
|
<td class="price">'.currency_code.''.number_format($transaction_item['item_price'] * $transaction_item['item_quantity'],2).'</td>
|
||||||
<td class="price"><?=currency_code?><?=number_format($transaction_item['price'] * $transaction_item['quantity'],2)?></td>
|
</tr>';
|
||||||
</tr>
|
}
|
||||||
<?php endforeach; ?>
|
|
||||||
</tbody>
|
$view .= ' </tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>';
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</div>
|
$view .= '
|
||||||
<?php elseif ($tab == 'downloads'): ?>
|
</div>';
|
||||||
<div class="mydownloads">
|
}
|
||||||
|
|
||||||
<h2><?=$h2_mydownloads?></h2>
|
elseif($tab == 'settings'){
|
||||||
|
|
||||||
<?php if (empty($downloads)): ?>
|
$view .= '<div class="settings">
|
||||||
<p><?=$mydownloads_message?></p>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($downloads): ?>
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2"><?=$mydownloads_product?></td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php $download_products_ids = []; ?>
|
|
||||||
<?php foreach ($transactions_items as $item): ?>
|
|
||||||
<?php if (isset($downloads[$item['product_id']]) && !in_array($item['product_id'], $download_products_ids)): ?>
|
|
||||||
<tr>
|
|
||||||
<td class="img">
|
|
||||||
<?php if (!empty($item['img']) && file_exists($item['img'])): ?>
|
|
||||||
<img src="<?=base_url?><?=$item['img']?>" width="50" height="50" alt="<?=$item['name']?>">
|
|
||||||
<?php endif; ?>
|
|
||||||
</td>
|
|
||||||
<td class="name"><?=$item['name']?></td>
|
|
||||||
<td>
|
|
||||||
<?php foreach ($downloads[$item['product_id']] as $download): ?>
|
|
||||||
<a href="<?=url('index.php?page=download&id=' . md5($item['txn_id'] . $download['id']))?>" download><i class="fa-solid fa-download fa-sm"></i><?=basename($download['file_path'])?></a>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php $download_products_ids[] = $item['product_id']; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
</div>
|
<h2>'.$h2_settings.'</h2>
|
||||||
<?php elseif ($tab == 'settings'): ?>
|
|
||||||
<div class="settings">
|
|
||||||
|
|
||||||
<h2><?=$h2_settings?></h2>
|
|
||||||
|
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
|
|
||||||
<label for="email" class="form-label"><?=$settings_email?></label>
|
<label for="email" class="form-label">'.$settings_email.'</label>
|
||||||
<input id="email" type="email" name="email" placeholder="<?=$settings_email?>" value="<?=htmlspecialchars($account['email'], ENT_QUOTES)?>" class="form-field" required>
|
<input id="email" type="email" name="email" placeholder="'.$settings_email.'" value="'.htmlspecialchars($identity['email'] ?? '', ENT_QUOTES).'" class="form-field" required>
|
||||||
|
|
||||||
<label for="password" class="form-label"><?=$settings_new_password?></label>
|
<label for="password" class="form-label">'.$settings_new_password.'</label>
|
||||||
<input type="password" id="password" name="password" placeholder="<?=$settings_new_password?>" value="" autocomplete="new-password" class="form-field">
|
<input type="password" id="password" name="password" placeholder="'.$settings_new_password.'" value="" autocomplete="new-password" class="form-field">
|
||||||
|
|
||||||
<label for="first_name" class="form-label"><?=$shipping_first_name?></label>
|
<label for="first_name" class="form-label">'.$shipping_first_name.'</label>
|
||||||
<input id="first_name" type="text" name="first_name" placeholder="<?=$shipping_first_name?>" value="<?=htmlspecialchars($account['first_name'], ENT_QUOTES)?>" class="form-field">
|
<input id="first_name" type="text" name="first_name" placeholder="'.$shipping_first_name.'" value="'.htmlspecialchars($identity['first_name'] ?? '', ENT_QUOTES).'" class="form-field">
|
||||||
|
|
||||||
<label for="last_name" class="form-label"><?=$shipping_last_name?></label>
|
<label for="last_name" class="form-label">'.$shipping_last_name.'</label>
|
||||||
<input id="last_name" type="text" name="last_name" placeholder="<?=$shipping_last_name?>" value="<?=htmlspecialchars($account['last_name'], ENT_QUOTES)?>" class="form-field">
|
<input id="last_name" type="text" name="last_name" placeholder="'.$shipping_last_name.'" value="'.htmlspecialchars($identity['last_name'] ?? '', ENT_QUOTES).'" class="form-field">
|
||||||
|
|
||||||
<label for="address_street" class="form-label"><?=$shipping_address?></label>
|
<label for="address_street" class="form-label">'.$shipping_address.'</label>
|
||||||
<input id="address_street" type="text" name="address_street" placeholder="<?=$shipping_address?>" value="<?=htmlspecialchars($account['address_street'], ENT_QUOTES)?>" class="form-field">
|
<input id="address_street" type="text" name="address_street" placeholder="'.$shipping_address.'" value="'.htmlspecialchars($identity['address_street'] ?? '', ENT_QUOTES).'" class="form-field">
|
||||||
|
|
||||||
<label for="address_city" class="form-label"><?=$shipping_city?></label>
|
<label for="address_city" class="form-label">'.$shipping_city.'</label>
|
||||||
<input id="address_city" type="text" name="address_city" placeholder="<?=$shipping_city?>" value="<?=htmlspecialchars($account['address_city'], ENT_QUOTES)?>" class="form-field">
|
<input id="address_city" type="text" name="address_city" placeholder="'.$shipping_city.'" value="'.htmlspecialchars($identity['address_city'] ?? '', ENT_QUOTES).'" class="form-field">
|
||||||
|
|
||||||
<label for="address_state" class="form-label"><?=$shipping_state?></label>
|
<label for="address_state" class="form-label">'.$shipping_state.'</label>
|
||||||
<input id="address_state" type="text" name="address_state" placeholder="<?=$shipping_state?>" value="<?=htmlspecialchars($account['address_state'], ENT_QUOTES)?>" class="form-field">
|
<input id="address_state" type="text" name="address_state" placeholder="'.$shipping_state.'" value="'.htmlspecialchars($identity['address_state'] ?? '', ENT_QUOTES).'" class="form-field">
|
||||||
|
|
||||||
<label for="address_zip" class="form-label"><?=$shipping_zip?></label>
|
<label for="address_zip" class="form-label">'.$shipping_zip.'</label>
|
||||||
<input id="address_zip" type="text" name="address_zip" placeholder="<?=$shipping_zip?>" value="<?=htmlspecialchars($account['address_zip'], ENT_QUOTES)?>" class="form-field">
|
<input id="address_zip" type="text" name="address_zip" placeholder="'.$shipping_zip.'" value="'.htmlspecialchars($identity['address_zip'] ?? '', ENT_QUOTES).'" class="form-field">
|
||||||
|
|
||||||
<label for="address_phone" class="form-label"><?=$shipping_phone?></label>
|
<label for="address_phone" class="form-label">'.$shipping_phone.'</label>
|
||||||
<input id="address_phone" type="text" name="address_phone" placeholder="<?=$shipping_phone?>" value="<?=htmlspecialchars($account['address_phone'], ENT_QUOTES)?>" class="form-field">
|
<input id="address_phone" type="text" name="address_phone" placeholder="'.$shipping_phone.'" value="'.htmlspecialchars($identity['address_phone'] ?? '', ENT_QUOTES).'" class="form-field">
|
||||||
|
|
||||||
<label for="address_country" class="form-label"><?=$shipping_country?></label>
|
<label for="address_country" class="form-label">'.$shipping_country.'</label>
|
||||||
<select id="address_country" name="address_country" required class="form-field">
|
<select id="address_country" name="address_country" required class="form-field">';
|
||||||
<?php foreach(get_countries() as $country): ?>
|
|
||||||
<option value="<?=$country?>"<?=$country==$account['address_country']?' selected':''?>><?=$country?></option>
|
foreach($countries as $country){
|
||||||
<?php endforeach; ?>
|
$view .= ' <option value="'.$country['id'].'" '.($country['id']==$identity['address_country'] ? ' selected' : '').'>'.(${$countryMap[$country['id']]} ?? $countryMap[$country['id']]).'</option>';
|
||||||
|
}
|
||||||
|
$view .= '
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<input name="save_details" type="submit" value="<?=$btn_settings_save?>" class="btn">
|
<input name="save_details" type="submit" value="'.$btn_settings_save.'" class="btn">
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>';
|
||||||
|
}
|
||||||
|
|
||||||
<?php endif; ?>
|
}
|
||||||
|
$view .= '</div>';
|
||||||
|
|
||||||
<?php endif; ?>
|
//OUTPUT
|
||||||
|
echo $view;
|
||||||
|
|
||||||
</div>
|
template_footer();
|
||||||
|
|
||||||
<?=template_footer()?>
|
|
||||||
28
product.php
@@ -194,14 +194,14 @@ $view .='<form id="product-form" action="" method="post">';
|
|||||||
|
|
||||||
$output .= '
|
$output .= '
|
||||||
<label class="picture_select_label">
|
<label class="picture_select_label">
|
||||||
<input id="'.$attribute['attribute_id'].'" class="option radio" value="'.$attribute['attribute_id'].'" name="product[option]['.$configuration['assignment'].'][]" type="radio" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? '').'" '.(($configuration['group_mandatory'] == 1 ) ? ' required' : '').'>
|
<input id="'.$attribute['attribute_id'].'" class="option radio" value="'.$attribute['attribute_id'].'" name="product[option]['.$configuration['assignment'].'][]" type="radio" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? 1).'" '.(($configuration['group_mandatory'] == 1 ) ? ' required' : '').'>
|
||||||
<span class="picture_select"><img '.$onclick.' src="'.$IMG_small_id.'"></span>
|
<span class="picture_select"><img '.$onclick.' src="'.$IMG_small_id.'"></span>
|
||||||
</label>';
|
</label>';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$output .= '
|
$output .= '
|
||||||
<label>
|
<label>
|
||||||
<input id="'.$attribute['attribute_id'].'>" class="option radio" value="'.$attribute['attribute_id'].'" name="product[option]['.$configuration['assignment'].'][]" type="radio" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? '').'" '.(($configuration['group_mandatory'] == 1 ) ? ' required' : '').'>'.(${$attribute['item_name']} ?? $attribute['item_name']).'
|
<input id="'.$attribute['attribute_id'].'>" class="option radio" value="'.$attribute['attribute_id'].'" name="product[option]['.$configuration['assignment'].'][]" type="radio" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? 1).'" '.(($configuration['group_mandatory'] == 1 ) ? ' required' : '').'>'.(${$attribute['item_name']} ?? $attribute['item_name']).'
|
||||||
</label>';
|
</label>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,14 +229,14 @@ $view .='<form id="product-form" action="" method="post">';
|
|||||||
|
|
||||||
$output .= '
|
$output .= '
|
||||||
<label class="picture_select_label">
|
<label class="picture_select_label">
|
||||||
<input id="'.$attribute['attribute_id'].'>" class="option checkbox" value="'.$attribute['attribute_id'].'" name="product[option]['.$configuration['assignment'].'][]" type="checkbox" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? '').'" '.(($configuration['group_mandatory'] == 1 ) ? ' required' : '').'>
|
<input id="'.$attribute['attribute_id'].'>" class="option checkbox" value="'.$attribute['attribute_id'].'" name="product[option]['.$configuration['assignment'].'][]" type="checkbox" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? 1).'" '.(($configuration['group_mandatory'] == 1 ) ? ' required' : '').'>
|
||||||
<span class="picture_select"><img '.$onclick.' src="'.$IMG_small_id.'"></span>
|
<span class="picture_select"><img '.$onclick.' src="'.$IMG_small_id.'"></span>
|
||||||
</label>';
|
</label>';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$output .= '
|
$output .= '
|
||||||
<label>
|
<label>
|
||||||
<input id="'.$attribute['attribute_id'].'>" class="option checkbox" value="'.$attribute['attribute_id'].'" name="product[option]['.$configuration['assignment'].'][]" type="checkbox" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? '').'" '.(($configuration['group_mandatory'] == 1 ) ? ' required' : '').'>'.(${$attribute['item_name']} ?? $attribute['item_name']).'
|
<input id="'.$attribute['attribute_id'].'>" class="option checkbox" value="'.$attribute['attribute_id'].'" name="product[option]['.$configuration['assignment'].'][]" type="checkbox" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? 1).'" '.(($configuration['group_mandatory'] == 1 ) ? ' required' : '').'>'.(${$attribute['item_name']} ?? $attribute['item_name']).'
|
||||||
</label>';
|
</label>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,12 +267,12 @@ $view .='<form id="product-form" action="" method="post">';
|
|||||||
$IMG_small_id = img_url.$attribute['full_path']; //URL TO SMALL IMAGE
|
$IMG_small_id = img_url.$attribute['full_path']; //URL TO SMALL IMAGE
|
||||||
|
|
||||||
$output .= '
|
$output .= '
|
||||||
<option id="'.$attribute['attribute_id'].'" value="'.$attribute['attribute_id'].'" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? '').'">'.(${$attribute['item_name']} ?? $attribute['item_name']).'</option>';
|
<option id="'.$attribute['attribute_id'].'" value="'.$attribute['attribute_id'].'" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? 1).'">'.(${$attribute['item_name']} ?? $attribute['item_name']).'</option>';
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$output .= '
|
$output .= '
|
||||||
<option id="'.$attribute['attribute_id'].'" value="'.$attribute['attribute_id'].'" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? '').'">'.(${$attribute['item_name']} ?? $attribute['item_name']).'</option>';
|
<option id="'.$attribute['attribute_id'].'" value="'.$attribute['attribute_id'].'" data-price="'.($attribute['price'] ?? 0).'" data-rrp="'.($attribute['rrp'] ?? 0).'" data-modifier="'.($attribute['price_modifier'] ?? 1).'">'.(${$attribute['item_name']} ?? $attribute['item_name']).'</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -303,12 +303,24 @@ $view .= '
|
|||||||
<script>
|
<script>
|
||||||
//Read urlstring
|
//Read urlstring
|
||||||
const queryString = window.location.href;
|
const queryString = window.location.href;
|
||||||
const option_id = queryString.substring(queryString.lastIndexOf(\'/\') + 1)
|
const option_id = queryString.substring(queryString.lastIndexOf(\'/\') + 1);
|
||||||
|
|
||||||
|
const url_slug = "'.($product['url_slug'] ?? $product['rowID']).'";
|
||||||
|
|
||||||
//Check for option_id
|
//Check for option_id
|
||||||
if (option_id != \'\'){
|
if (option_id != url_slug){
|
||||||
document.getElementById(option_id).checked = true;
|
document.getElementById(option_id).checked = true;
|
||||||
|
} else {
|
||||||
|
// Get all radio buttons
|
||||||
|
const radioButtons = document.querySelectorAll(\'.picture_select_label input[type="radio"]\');
|
||||||
|
|
||||||
|
// Select the first radio button if any exist
|
||||||
|
if (radioButtons.length > 0) {
|
||||||
|
radioButtons[0].checked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>';
|
</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ $view .=' <h2>'.$h1_content_top.'</h2>
|
|||||||
if(show_offer_product_page){
|
if(show_offer_product_page){
|
||||||
$view .= '
|
$view .= '
|
||||||
<div class="" style="text-align: center;">
|
<div class="" style="text-align: center;">
|
||||||
<p class="p.paragraph.neutral-paragraph-text-1" style="font-family:\'gerb\';font-size: 15px;">'.${show_offer_product_text} ?? show_offer_product_text.'</p>
|
<p class="p.paragraph.neutral-paragraph-text-1" style="font-family:\'gerb\';font-size: 15px;">'.(${show_offer_product_text} ?? show_offer_product_text).'</p>
|
||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@ $view .= '<div class="products-wrapper">';
|
|||||||
$view .= '
|
$view .= '
|
||||||
<div class="product">
|
<div class="product">
|
||||||
<a href="'.url('index.php?page=product&rowID=' . ($product['url_slug'] ? ($product['url_slug'] ) : $product['rowID'])).'" id="'.$product['rowID'].'A" class="product">
|
<a href="'.url('index.php?page=product&rowID=' . ($product['url_slug'] ? ($product['url_slug'] ) : $product['rowID'])).'" id="'.$product['rowID'].'A" class="product">
|
||||||
<img src="'.img_url.$product['full_path'].'" id="'.$product['rowID'].'" width="200" height="" alt="'.(${$product['productname']} ?? $product['productname']).'">
|
<img src="'.img_url.$product['full_path'].'" id="'.$product['rowID'].'" width="" height="250" alt="'.(${$product['productname']} ?? $product['productname']).'">
|
||||||
</a>';
|
</a>';
|
||||||
|
|
||||||
//CHECK IF CONFIGURATION SETTING IS FOUND AND NOT EMPTY => USE GROUP TO DISPLAY IMAGES
|
//CHECK IF CONFIGURATION SETTING IS FOUND AND NOT EMPTY => USE GROUP TO DISPLAY IMAGES
|
||||||
|
|||||||
30
script.js
@@ -16,13 +16,27 @@ searchInput.onkeyup = event => {
|
|||||||
};
|
};
|
||||||
if (document.querySelector('.product-img-small')) {
|
if (document.querySelector('.product-img-small')) {
|
||||||
let imgs = document.querySelectorAll('.product-img-small img');
|
let imgs = document.querySelectorAll('.product-img-small img');
|
||||||
|
let mainImg = document.querySelector('.product-img-large img');
|
||||||
|
let originalSrc = mainImg.src; // Store the original image source
|
||||||
|
|
||||||
imgs.forEach(img => {
|
imgs.forEach(img => {
|
||||||
img.onmouseover = () => {
|
img.onmouseover = () => {
|
||||||
document.querySelector('.product-img-large img').src = img.src;
|
document.querySelector('.product-img-large img').src = img.src;
|
||||||
imgs.forEach(i => i.parentElement.classList.remove('selected'));
|
imgs.forEach(i => i.parentElement.classList.remove('selected'));
|
||||||
img.parentElement.classList.add('selected');
|
img.parentElement.classList.add('selected');
|
||||||
};
|
};
|
||||||
/*img.onclick = () => {
|
// On mouse out - restore to the original image
|
||||||
|
img.onmouseout = () => {
|
||||||
|
mainImg.src = originalSrc;
|
||||||
|
imgs.forEach(i => i.parentElement.classList.remove('selected'));
|
||||||
|
// Optionally re-select the original thumbnail
|
||||||
|
imgs.forEach(i => {
|
||||||
|
if (i.src === originalSrc) {
|
||||||
|
i.parentElement.classList.add('selected');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
img.onclick = () => {
|
||||||
document.body.insertAdjacentHTML('beforeend', `
|
document.body.insertAdjacentHTML('beforeend', `
|
||||||
<div class="img-modal">
|
<div class="img-modal">
|
||||||
<div>
|
<div>
|
||||||
@@ -39,13 +53,19 @@ if (document.querySelector('.product-img-small')) {
|
|||||||
document.querySelector('.img-modal').onclick = event => {
|
document.querySelector('.img-modal').onclick = event => {
|
||||||
if (event.target.classList.contains('img-modal')) document.querySelector('.img-modal').remove();
|
if (event.target.classList.contains('img-modal')) document.querySelector('.img-modal').remove();
|
||||||
};
|
};
|
||||||
};*/
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (document.querySelector('.product #product-form')) {
|
if (document.querySelector('.product #product-form')) {
|
||||||
let updatePrice = () => {
|
let updatePrice = () => {
|
||||||
let price = parseFloat(document.querySelector('.product .price').dataset.price);
|
let price = parseFloat(document.querySelector('.product .price').dataset.price);
|
||||||
let rrp = parseFloat(document.querySelector('.product .rrp').dataset.rrp);
|
|
||||||
|
let rrp = document.querySelector('.product .rrp') ?? 0;
|
||||||
|
|
||||||
|
if (rrp !=0)
|
||||||
|
{
|
||||||
|
rrp = parseFloat(document.querySelector('.product .rrp').dataset.rrp) ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
document.querySelectorAll('.product #product-form .option').forEach(e => {
|
document.querySelectorAll('.product #product-form .option').forEach(e => {
|
||||||
if (e.value) {
|
if (e.value) {
|
||||||
@@ -62,8 +82,10 @@ if (document.querySelector('.product #product-form')) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
document.querySelector('.product .price').innerHTML = currency_code + (price > 0.00 ? price.toFixed(2) : 0.00);
|
document.querySelector('.product .price').innerHTML = currency_code + (price > 0.00 ? price.toFixed(2) : 0.00);
|
||||||
|
if (rrp !=0)
|
||||||
|
{
|
||||||
document.querySelector('.product .rrp').innerHTML = currency_code + (rrp > 0.00 ? rrp.toFixed(2) : 0.00);
|
document.querySelector('.product .rrp').innerHTML = currency_code + (rrp > 0.00 ? rrp.toFixed(2) : 0.00);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
document.querySelectorAll('.product #product-form .option').forEach(ele => ele.onchange = () => updatePrice());
|
document.querySelectorAll('.product #product-form .option').forEach(ele => ele.onchange = () => updatePrice());
|
||||||
updatePrice();
|
updatePrice();
|
||||||
|
|||||||
BIN
uploads/1-Morval-Watches2024-V1-Blue-Black-Date normaal.png
Normal file
|
After Width: | Height: | Size: 203 KiB |
BIN
uploads/1-Morval-Watches2024-V1-Blue-Brown-Date normaal.png
Normal file
|
After Width: | Height: | Size: 212 KiB |
BIN
uploads/1-Morval-Watches2024-V1-Blue-Calf-Date normaal.png
Normal file
|
After Width: | Height: | Size: 219 KiB |
BIN
uploads/1-Morval-Watches2024-V1-Blue-DarkBlue-Date normaal.png
Normal file
|
After Width: | Height: | Size: 214 KiB |
BIN
uploads/1-Morval-Watches2024-V1-Blue-Steel-Date normaal.png
Normal file
|
After Width: | Height: | Size: 185 KiB |
BIN
uploads/1-Morval-Watches2024-V1-DarkGrey-Black-Soft normaal.png
Normal file
|
After Width: | Height: | Size: 198 KiB |
BIN
uploads/1-Morval-Watches2024-V1-DarkGrey-Brown-Date normaal.png
Normal file
|
After Width: | Height: | Size: 203 KiB |
BIN
uploads/1-Morval-Watches2024-V1-DarkGrey-Calf-Date normaal.png
Normal file
|
After Width: | Height: | Size: 210 KiB |
BIN
uploads/1-Morval-Watches2024-V1-Darkgrey-Black-Date normaal.png
Normal file
|
After Width: | Height: | Size: 193 KiB |
BIN
uploads/1-Morval-Watches2024-V1-Darkgrey-DarkBlue normaal.png
Normal file
|
After Width: | Height: | Size: 211 KiB |
|
After Width: | Height: | Size: 205 KiB |
BIN
uploads/1-Morval-Watches2024-V1-Darkgrey-Steel-Date normaal.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
BIN
uploads/1-Morval-Watches2024-V1-LightBlue-DarkBlue normaal.png
Normal file
|
After Width: | Height: | Size: 204 KiB |
BIN
uploads/Morval-Watches2024-V1-Blue-Black normaal.png
Normal file
|
After Width: | Height: | Size: 207 KiB |
BIN
uploads/Morval-Watches2024-V1-Blue-Black-Date normaal.png
Normal file
|
After Width: | Height: | Size: 203 KiB |
BIN
uploads/Morval-Watches2024-V1-Blue-Brown normaal.png
Normal file
|
After Width: | Height: | Size: 216 KiB |
BIN
uploads/Morval-Watches2024-V1-Blue-Brown-Date normaal.png
Normal file
|
After Width: | Height: | Size: 212 KiB |
BIN
uploads/Morval-Watches2024-V1-Blue-Calf normaal.png
Normal file
|
After Width: | Height: | Size: 223 KiB |
BIN
uploads/Morval-Watches2024-V1-Blue-Calf-Date normaal.png
Normal file
|
After Width: | Height: | Size: 219 KiB |
BIN
uploads/Morval-Watches2024-V1-Blue-DarkBlue normaal.png
Normal file
|
After Width: | Height: | Size: 218 KiB |
BIN
uploads/Morval-Watches2024-V1-Blue-DarkBlue-Date normaal.png
Normal file
|
After Width: | Height: | Size: 214 KiB |
BIN
uploads/Morval-Watches2024-V1-Blue-Steel normaal.png
Normal file
|
After Width: | Height: | Size: 189 KiB |
BIN
uploads/Morval-Watches2024-V1-Blue-Steel-Date normaal.png
Normal file
|
After Width: | Height: | Size: 185 KiB |
BIN
uploads/Morval-Watches2024-V1-DarkGrey-Black-Soft normaal.png
Normal file
|
After Width: | Height: | Size: 198 KiB |
BIN
uploads/Morval-Watches2024-V1-DarkGrey-Brown normaal.png
Normal file
|
After Width: | Height: | Size: 208 KiB |
BIN
uploads/Morval-Watches2024-V1-DarkGrey-Brown-Date normaal.png
Normal file
|
After Width: | Height: | Size: 203 KiB |
BIN
uploads/Morval-Watches2024-V1-DarkGrey-Calf normaal.png
Normal file
|
After Width: | Height: | Size: 215 KiB |
BIN
uploads/Morval-Watches2024-V1-DarkGrey-Calf-Date normaal.png
Normal file
|
After Width: | Height: | Size: 210 KiB |
BIN
uploads/Morval-Watches2024-V1-DarkGrey-Steel normaal.png
Normal file
|
After Width: | Height: | Size: 181 KiB |
BIN
uploads/Morval-Watches2024-V1-Darkgrey-Black-Date normaal.png
Normal file
|
After Width: | Height: | Size: 193 KiB |
BIN
uploads/Morval-Watches2024-V1-Darkgrey-DarkBlue normaal.png
Normal file
|
After Width: | Height: | Size: 211 KiB |
BIN
uploads/Morval-Watches2024-V1-Darkgrey-DarkBlue-Date normaal.png
Normal file
|
After Width: | Height: | Size: 205 KiB |
BIN
uploads/Morval-Watches2024-V1-Darkgrey-Steel-Date normaal.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
BIN
uploads/Morval-Watches2024-V1-Green-Black normaal.png
Normal file
|
After Width: | Height: | Size: 207 KiB |
BIN
uploads/Morval-Watches2024-V1-Green-Black-Date normaal.png
Normal file
|
After Width: | Height: | Size: 204 KiB |
BIN
uploads/Morval-Watches2024-V1-Green-Brown-Date normaal.png
Normal file
|
After Width: | Height: | Size: 214 KiB |
BIN
uploads/Morval-Watches2024-V1-Green-Calf-Date normaal.png
Normal file
|
After Width: | Height: | Size: 220 KiB |
BIN
uploads/Morval-Watches2024-V1-Green-DarkBlue normaal.png
Normal file
|
After Width: | Height: | Size: 219 KiB |
BIN
uploads/Morval-Watches2024-V1-Green-DarkBlue-Date normaal.png
Normal file
|
After Width: | Height: | Size: 216 KiB |
BIN
uploads/Morval-Watches2024-V1-Green-Steel-Date normaal.png
Normal file
|
After Width: | Height: | Size: 187 KiB |
BIN
uploads/Morval-Watches2024-V1-Grey-Black normaal.png
Normal file
|
After Width: | Height: | Size: 203 KiB |
BIN
uploads/Morval-Watches2024-V1-Grey-Black-Date normaal.png
Normal file
|
After Width: | Height: | Size: 198 KiB |
BIN
uploads/Morval-Watches2024-V1-Grey-Brown-Date normaal.png
Normal file
|
After Width: | Height: | Size: 209 KiB |
BIN
uploads/Morval-Watches2024-V1-Grey-Calf-Date normaal.png
Normal file
|
After Width: | Height: | Size: 215 KiB |
BIN
uploads/Morval-Watches2024-V1-Grey-DarkBlue normaal.png
Normal file
|
After Width: | Height: | Size: 216 KiB |
BIN
uploads/Morval-Watches2024-V1-Grey-DarkBlue-Date normaal.png
Normal file
|
After Width: | Height: | Size: 211 KiB |
BIN
uploads/Morval-Watches2024-V1-Grey-Steel-Date normaal.png
Normal file
|
After Width: | Height: | Size: 181 KiB |
BIN
uploads/Morval-Watches2024-V1-LighBlue-Steel-Date normaal.png
Normal file
|
After Width: | Height: | Size: 169 KiB |
BIN
uploads/Morval-Watches2024-V1-LightBlue-Black normaal.png
Normal file
|
After Width: | Height: | Size: 191 KiB |
BIN
uploads/Morval-Watches2024-V1-LightBlue-Calf-Date normaal.png
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
uploads/Morval-Watches2024-V1-LightBlue-DarkBlue normaal.png
Normal file
|
After Width: | Height: | Size: 204 KiB |
|
After Width: | Height: | Size: 198 KiB |
BIN
uploads/Morval-Watches2024-V1-Lightblue-Black-Date normaal.png
Normal file
|
After Width: | Height: | Size: 186 KiB |
BIN
uploads/Morval-Watches2024-V1-Lightblue-Brown-Date normaal.png
Normal file
|
After Width: | Height: | Size: 196 KiB |
BIN
uploads/Morval_achterkant.png
Normal file
|
After Width: | Height: | Size: 25 MiB |
BIN
uploads/ThomasI-II-limited.png
Normal file
|
After Width: | Height: | Size: 191 KiB |
BIN
uploads/morval-crown.jpg
Normal file
|
After Width: | Height: | Size: 414 KiB |
BIN
uploads/morval_band_connect1.jpg
Normal file
|
After Width: | Height: | Size: 288 KiB |
BIN
uploads/morval_band_connect2.jpg
Normal file
|
After Width: | Height: | Size: 346 KiB |
BIN
uploads/morval_box.jpg
Normal file
|
After Width: | Height: | Size: 300 KiB |
BIN
uploads/morval_closure.jpg
Normal file
|
After Width: | Height: | Size: 270 KiB |
@@ -5,8 +5,8 @@ define('interface', true);
|
|||||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
// Includes
|
// Includes
|
||||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
include '/custom/settings/config.php';
|
include './custom/settings/config.php';
|
||||||
include 'functions.php';
|
include './functions.php';
|
||||||
|
|
||||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
//LOGIN TO API
|
//LOGIN TO API
|
||||||
@@ -76,7 +76,9 @@ try {
|
|||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
//Send the invoice when status is Paid
|
//Send the invoice when status is Paid
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
list($data,$customer_email,$order_id) = generateInvoice($invoice_cust,$orderId);
|
$invoice_language = strtoupper($invoice_cust['customer']['language']!= '' ? $invoice_cust['customer']['language'] : $responses['language']);
|
||||||
|
|
||||||
|
list($data,$customer_email,$order_id) = generateInvoice($invoice_cust,$orderId,$invoice_language);
|
||||||
|
|
||||||
//CREATE PDF
|
//CREATE PDF
|
||||||
$dompdf->loadHtml($data);
|
$dompdf->loadHtml($data);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
// Include the configuration file, this contains settings you can change.
|
// Include the configuration file, this contains settings you can change.
|
||||||
include '/custom/settings/config.php';
|
include './custom/settings/config.php';
|
||||||
// Include functions and connect to the database using PDO MySQL
|
// Include functions and connect to the database using PDO MySQL
|
||||||
include 'functions.php';
|
include './functions.php';
|
||||||
|
|
||||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
//LOGIN TO API
|
//LOGIN TO API
|
||||||
@@ -73,7 +73,9 @@ if($token !=''){
|
|||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
//Send the invoice when status is Paid
|
//Send the invoice when status is Paid
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
list($data,$customer_email,$order_id) = generateInvoice($invoice_cust,$orderId);
|
$invoice_language = strtoupper($invoice_cust['customer']['language']!= '' ? $invoice_cust['customer']['language'] : $responses['language']);
|
||||||
|
|
||||||
|
list($data,$customer_email,$order_id) = generateInvoice($invoice_cust,$orderId,$invoice_language);
|
||||||
|
|
||||||
//CREATE PDF
|
//CREATE PDF
|
||||||
$dompdf->loadHtml($data);
|
$dompdf->loadHtml($data);
|
||||||
|
|||||||