CMXX - First testing

This commit is contained in:
“VeLiTi”
2025-03-07 15:07:15 +01:00
parent 5dd2973a26
commit cd0e04981c
81 changed files with 697 additions and 325 deletions

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"php.version": "8.4"
}

View File

@@ -31,10 +31,10 @@ if (!isset($_SESSION['account_loggedin'])) {
exit;
}
// If the user is not admin redirect them back to the shopping cart home page
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE id = ?');
$stmt->execute([ $_SESSION['account_id'] ]);
$account = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$account || $account['role'] != 'Admin') {
$account = ioAPIv2('/v2/identity/userkey='.$_SESSION['account_id'].'&isverified=1','',$clientsecret);
$account = json_decode($account,true);
if (!$account || $account[0]['profile'] != 1) {
header('Location: ' . url('../index.php'));
exit;
}

View File

@@ -6,7 +6,7 @@ defined(security_key) or exit;
// Defaults
// ---------------------------------------
$account = [
'account_id' => $_POST['account_id'] ?? '',
'account_id' => $_SESSION['account_id'] ?? '',
'email' => $_POST['email'] ?? '',
'first_name' => $_POST['first_name'] ?? '',
'last_name' => $_POST['last_name'] ?? '',
@@ -58,10 +58,12 @@ if (empty($_SESSION['cart'])) {
// Check if user is logged in
if (isset($_SESSION['account_loggedin'])) {
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE id = ?');
$stmt->execute([ $_SESSION['account_id'] ]);
// Fetch the account from the database and return the result as an Array
$account = $stmt->fetch(PDO::FETCH_ASSOC);
$api_url = '/v2/identity/userkey='.$_SESSION['account_id'];
$account = ioAPIv2($api_url,'',$clientsecret);
if (!empty($account)){$account = json_decode($account,true);}
$account = $account[0];
//RESET ACCOUNT_ID
$account['account_id'] = $account['userkey'];
}
// 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 (isset($_SESSION['account_loggedin'])) {
// 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 = ?');
$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'] ]);
$account_id = $_SESSION['account_id'];
$payload = json_encode(
array(
"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'])) {
// 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 = ?');
$stmt->execute([ $_POST['email'] ]);
if ($stmt->fetch(PDO::FETCH_ASSOC)) {
// Check if the account exists
$account = ioAPIv2('/v2/identity/email='.$_POST['email'],'',$clientsecret);
$account = json_decode($account,true);
if ($account) {
// Email exists, user should login instead...
$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;
}
if (!$errors) {
// Hash the password
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
// Email doesnt exist, create new account
$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 (?,?,?,?,?,?,?,?,?,?)');
$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'] ]);
$account_id = $pdo->lastInsertId();
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE id = ?');
$stmt->execute([ $account_id ]);
// Fetch the account from the database and return the result as an Array
$account = $stmt->fetch(PDO::FETCH_ASSOC);
// Account doesnt exist, create new account
$payload = json_encode(
array(
"email" => $_POST['email'],
"password" => $_POST['password'],
"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']), 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) {
$errors[] = $error_account;
@@ -205,7 +240,7 @@ if (isset($_POST['method'], $_POST['first_name'], $_POST['last_name'], $_POST['a
session_regenerate_id();
$_SESSION['account_loggedin'] = TRUE;
$_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 {
/*
@@ -290,7 +325,7 @@ if (isset($_POST['method'], $_POST['first_name'], $_POST['last_name'], $_POST['a
// PayPal Payment = 1 +++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if (paypal_enabled && $_POST['method'] == 'paypal') {
if (paypal_enabled && $_POST['method'] == 1) {
//Process Payment
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">';
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">
<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.'">
@@ -420,7 +455,7 @@ $view .= '
<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>
<select name="address_country" class="ajax-update form-field" required>';
@@ -462,7 +497,7 @@ $view .= ' </span>
foreach($shipping_methods as $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>
</div>';
}

View File

@@ -2034,3 +2034,58 @@ input.banner_deny:hover {
width: 20px;
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;
}

View File

@@ -35,7 +35,7 @@ function template_header($title, $head = '') {
$default_country = isset($_SESSION['country_code']) ? strtolower($_SESSION['country_code']) : language_code;
//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
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/custom.css" rel="stylesheet" type="text/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
$head
</head>
<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>
<div class="content-wrapper">
<h1>
@@ -145,7 +248,7 @@ function template_header_top($title, $head = '') {
$about_link = url('index.php?page=about');
$myaccount_link = url('index.php?page=myaccount');
$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>' : '';
$site_name = site_name;
$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/custom.css" rel="stylesheet" type="text/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
$head
</head>
<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>
$banner
$age_consent
@@ -215,7 +421,7 @@ function template_menu(){
$default_country = isset($_SESSION['country_code']) ? strtolower($_SESSION['country_code']) : language_code;
//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
@@ -346,8 +552,11 @@ function template_footer() {
// Order email
//++++++++++++++++++++++++++++++++++++++++++++++++++++
//Template header order email
function template_order_email_header() {
include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
function template_order_email_header($user_language) {
$user_language = ((isset($_SESSION['country_code']))? $_SESSION['country_code'] :$user_language);
include './custom/translations/translations_'.strtoupper($user_language).'.php';
$home_link = url('index.php');
$myaccount_link = url('index.php?page=myaccount');

View File

@@ -1,16 +1,4 @@
<?php
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.';
<?php defined(security_key) or exit;
//------------------------------------------
// 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;">
<!-- Header -->
<tr>
<td class="header" style="background-color:#005655; padding: 40px; text-align: center; color: white; font-size: 24px;">
CustomerPortal
<td class="header" style="background-color:'.color.'; padding: 40px; text-align: center; color: white; font-size: 24px;">
'.site_title.'
</td>
</tr>
@@ -55,7 +43,7 @@ $message = '
'.$newuser_header.',
<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>
'.$newuser_credential_text_2.'
@@ -68,8 +56,8 @@ $message = '
<!-- CTA Button -->
<table cellspacing="0" cellpadding="0" style="margin: auto;">
<tr>
<td align="center" style="background-color: #008685; 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>
<td align="center" style="background-color: '.color_accent.'; padding: 10px 20px; border-radius: 5px;">
<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>
</tr>
</table>
@@ -80,17 +68,17 @@ $message = '
'.$newuser_closure.'
<br>
<br>
Kind regards,
'.$newuser_signature.'
<br>
<br>
Service team
'.$newuser_signature_name.'
<br>
<br>
</td>
</tr>
<!-- Footer -->
<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>
</tr>
</table>

View File

@@ -1,13 +1,4 @@
<?php
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.';
<?php defined(security_key) or exit;
//------------------------------------------
// Content Reset Email
@@ -42,7 +33,7 @@ $message = '
<!-- Header -->
<tr>
<td class="header" style="background-color:#005655; padding: 40px; text-align: center; color: white; font-size: 24px;">
CustomerPortal
'.site_title.'
</td>
</tr>
@@ -66,7 +57,7 @@ $message = '
<table cellspacing="0" cellpadding="0" style="margin: auto;">
<tr>
<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>
</tr>
</table>
@@ -77,17 +68,17 @@ $message = '
'.$changeuser_closure.'
<br>
<br>
Kind regards,
'.$changeuser_signature.'
<br>
<br>
Service team
'.$changeuser_signature_name.'
<br>
<br>
</td>
</tr>
<!-- Footer -->
<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>
</tr>
</table>

View File

@@ -1,6 +1,6 @@
<?php defined(security_key) or exit; ?>
<?=template_order_email_header()?>
<?=template_order_email_header('')?>
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
</tr>
<tr><td><br></td></tr>
@@ -39,9 +39,17 @@
</thead>
<tbody>
<?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>
<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><?=currency_code?><?=number_format($product['options_price'],2)?></td>
<td style="text-align:right;"><?=number_format($product['options_price'] * $product['quantity'],2)?></td>

View File

@@ -2,8 +2,8 @@
//(defined(security_key) or defined('admin')) or exit; ?>
<?=template_order_email_header()?>
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
<?=template_order_email_header($user_language)?>
<?php include './custom/translations/translations_'.strtoupper($user_language).'.php';?>
</tr>
<tr><td><br></td></tr>
<tr>
@@ -39,9 +39,18 @@
<tbody>
<?php
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>
<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><?=currency_code?> <?=number_format($product['price'],2)?></td>
<td style="text-align:right;"><?=currency_code?> <?=number_format($product['line_total'],2)?></td>

View File

@@ -1,6 +1,6 @@
<?php defined(security_key) or exit; ?>
<?=template_order_email_header()?>
<?=template_order_email_header('')?>
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
</tr>
@@ -19,8 +19,8 @@
<h1><?=$order_email_message_1?></h1>
<p><?=$order_email_message_2?></p></td>
<td>
<p>Order: <?=$order_id?></p>
<p>Date: <?php echo date("Y-m-d");?></p></td>
<p><?=$order_invoice_text ?? 'Invoice'?>: <?=$order_id?></p>
<p><?=$order_date_text ?? 'Date'?>: <?php echo date("Y-m-d");?></p></td>
</tr>
</table>
</div>
@@ -40,9 +40,17 @@
</thead>
<tbody>
<?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>
<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><?=currency_code?><?=number_format($product['options_price'],2)?></td>
<td style="text-align:right;"><?=number_format($product['options_price'] * $product['quantity'],2)?></td>

View File

@@ -17,6 +17,7 @@ define('age_verification_enabled',false);
define('veliti_analytics',false);
// Default logtraffic
define('log_usage',false);
/* Banners */
// Show offer at home page
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
define('show_offer_product_page',true);
define('show_offer_product_text','Free shipping on all of our watches');
//Banner at site entry
define('banner_enabled',false);
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_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 */
// Homepage highlightedproducts
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');
// ABOUT MORVAL image 3
define('about_morval_image_3','custom/assets/morval_about_morval_monument_overzicht.png');
//Icon
define('icon_image','custom/assets/MORVALFavicon.svg');
//Banner
define('banner_background','custom/assets/morval_banner.jpg');
@@ -133,8 +139,6 @@ define('mail_enabled',true);
define('email','info@gewoonlekkerspaans.nl');
// Receive email notifications?
define('email_notifications',false);
//EMAIL LOGO
define('emaillogo','custom/assets/MORVALFavicon.svg');
//Additional phpmailer-settings
define('email_host_name','gewoonlekkerspaans.nl');
define('email_reply_to','info@gewoonlekkerspaans.nl');
@@ -152,10 +156,10 @@ define('db_pass','4~gv71bM6');
// Database name
define('db_name','shoppingcart_advanced'); //morvalwatches
/* API */
define('clientID','paul@veliti.nl'); //morvalwatches
define('clientsecret','test1234'); //morvalwatches
define('clientID','MorvalWatches'); //morvalwatches
define('clientsecret','MW2024!'); //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 */
//Pay on Delivery

View File

@@ -151,7 +151,7 @@ function send_order_details_email($email, $products, $first_name, $last_name, $a
return;
}
$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();
include './custom/email/order-details-template.php';
$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';
$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';
//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
$customer_email = htmlspecialchars($invoice['customer']['email'] ?? '', ENT_QUOTES);
$customer_email = htmlspecialchars($invoice_cust['customer']['email'] ?? '', ENT_QUOTES);
//Generate invoice
ob_start();
include dirname(__FILE__).'/custom/email/order-invoice-template.php';

View File

@@ -29,7 +29,7 @@ $view = '
if(show_offer_home_page){
$view .='
<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>';
}
$view .='

View File

@@ -90,6 +90,7 @@ $url = routes([
'/products/{category}/{sort}' => 'products.php',
'/products/{p}/{category}/{sort}' => 'products.php',
'/myaccount' => 'myaccount.php',
'/myaccount/{activation_key}' => 'myaccount.php',
'/myaccount/{tab}' => 'myaccount.php',
'/download/{id}' => 'download.php',
'/cart' => 'cart.php',

View File

@@ -1,6 +1,46 @@
<?php
// Prevent direct access to file
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
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_id'] = $account['accountID'];
$_SESSION['account_role'] = $account['profile'];
$_SESSION['country_code'] = $account['language'];
$products_in_cart = isset($_SESSION['cart']) ? $_SESSION['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
if (isset($_POST['register'], $_POST['email'], $_POST['password'], $_POST['cpassword']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
// Check if the account exists
$account = ioAPIv2('/v2/identity/email='.$_POST['email'],'',$clientsecret);
$account = json_decode($account,true);
if ($account) {
// Account exists!
$register_error = $error_myaccount_exists;
$register_error = 'Account already exists';
;
} else if ($_POST['cpassword'] != $_POST['password']) {
$register_error = 'Passwords do not match!';
} else if (strlen($_POST['password']) > 20 || strlen($_POST['password']) < 5) {
// 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 {
// 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= json_decode($account,true);
if ($account && isset($account['accountID'])) {
//SEND VERIFICATION EMAIL
ob_start();
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,'', '');
exit;
send_mail_by_PHPMailer($account['identity'], $subject, $register_mail,'', '');
$register_error = 'Email send to verify your account';
}
}
}
// 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 (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');
$stmt->execute([ $_SESSION['account_id'] ]);
$transactions = $stmt->fetchAll(PDO::FETCH_ASSOC);
// Select all the users transations, which will appear under "My Orders"
$stmt = $pdo->prepare('SELECT
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 = [];
}
//CALL TO API
$api_url = '/v2/transactions_items/account_id='.$_SESSION['account_id'];
$orders = ioAPIv2($api_url,'',$clientsecret);
//Decode Payload
if (!empty($orders)){$orders = json_decode($orders,true);}else{$orders = null;}
// Retrieve account details
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE id = ?');
$stmt->execute([ $_SESSION['account_id'] ]);
$account = $stmt->fetch(PDO::FETCH_ASSOC);
$api_url = '/v2/identity/userkey='.$_SESSION['account_id'];
$identity = ioAPIv2($api_url,'',$clientsecret);
//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
if (isset($_POST['save_details'], $_POST['email'], $_POST['password'])) {
// Assign and validate input data
@@ -117,235 +144,231 @@ if (isset($_SESSION['account_loggedin'])) {
$address_zip = isset($_POST['address_zip']) ? $_POST['address_zip'] : '';
$address_country = isset($_POST['address_country']) ? $_POST['address_country'] : '';
$address_phone = isset($_POST['address_phone']) ? $_POST['address_phone'] : '';
// Check if account exists with captured email
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE email = ?');
$stmt->execute([ $_POST['email'] ]);
// Validation
if ($_POST['email'] != $account['email'] && $stmt->fetch(PDO::FETCH_ASSOC)) {
$error = 'Account already exists with that email!';
} else if ($_POST['password'] && (strlen($_POST['password']) > 20 || strlen($_POST['password']) < 5)) {
$error = 'Password must be between 5 and 20 characters long!';
} else {
// 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 = ?');
$stmt->execute([ $_POST['email'], $password, $first_name, $last_name, $address_street, $address_city, $address_state, $address_zip, $address_country, $address_phone, $_SESSION['account_id'] ]);
if ($_POST['email'] != $identity['email']) {
// Check if the account exists
$account = ioAPIv2('/v2/identity/email='.$_POST['email'],'',$clientsecret);
$account = json_decode($account,true);
if ($account) {
// Account exists with change email
$error = $error_myaccount_exists;
}
}
elseif (strlen($_POST['password']) > 20 || strlen($_POST['password']) < 5) {
// 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
header('Location: ' . url('index.php?page=myaccount&tab=settings'));
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">
<h1><?=$h1_login?></h1>
<h1>'.$h1_login.'</h1>
<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">
<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">
<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 name="login" type="submit" value="<?=$h1_login?>" class="btn">
<input name="login" type="submit" value="'.$h1_login.'" class="btn">
</form>
</form>';
<?php if ($error): ?>
<p class="error"><?=$error?></p>
<?php endif; ?>
if($error){
$view .= '<p class="error">'.$error.'</p>';
}
</div>
$view .= '</div>
<div class="register">
<h1><?=$h1_register?></h1>
<h1>'.$h1_register.'</h1>
<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">
<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">
<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">
<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">
<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 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): ?>
<p class="error"><?=$register_error?></p>
<?php endif; ?>
if($register_error){
$view .= '<p class="error">'.$register_error.'</p>';
}
</div>
$view .= ' </div>
</div>
</div>';
<?php else: ?>
//++++++++++++++++++++++++++++++++++++++++
//MY ACCOUNT DETAILS
//++++++++++++++++++++++++++++++++++++++++
<h1><?=$h1_myaccount?></h1>
} else {
$view .= '<h1>'.$h1_myaccount.'</h1>
<div class="menu">
<h2><?=$h2_menu?></h2>
<h2>'.$h2_menu.'</h2>
<div class="menu-items">
<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').'">'.$menu_orders.'</a>
<a href="'.url('index.php?page=myaccount&tab=settings').'">'.$menu_settings.'</a>
</div>
</div>
</div>';
<?php if ($tab == 'orders'): ?>
<div class="myorders">
if($tab == 'orders'){
$view .= '<div class="myorders">
<h2><?=$h2_myorders?></h2>
<h2>'.$h2_myorders.'</h2>';
<?php if (empty($transactions)): ?>
<p><?=$myorders_message?></p>
<?php endif; ?>
<?php foreach ($transactions as $transaction): ?>
<div class="order">
if(empty($orders)){
$view .= '<p>'.$myorders_message.'</p>';
}
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>
<div><span><?=$myorders_order?></span># <?=$transaction['id']?></div>
<div class="rhide"><span><?=$myorders_date?></span><?=date('F j, Y', strtotime($transaction['created']))?></div>
<div><span><?=$myorders_status?></span><?=$transaction['payment_status']?></div>
<div><span>'.$myorders_order.'</span># '.$order['header']['id'].'</div>
<div class="rhide"><span>'.$myorders_date.'</span>'.date('F j, Y', strtotime($order['header']['created'])).'</div>
<div><span>'.$myorders_status.'</span>'.(${$payment_status} ?? $order['header']['payment_status']).'</div>
</div>
<div>
<div class="rhide"><span><?=$myorders_shipping?></span><?=currency_code?><?=number_format($transaction['shipping_amount'],2)?></div>
<div><span><?=$myorders_total?></span><?=currency_code?><?=number_format($transaction['payment_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($order['header']['payment_amount'],2).'</div>
</div>
</div>
<div class="order-items">
<table>
<tbody>
<?php foreach ($transactions_items as $transaction_item): ?>
<?php if ($transaction_item['txn_id'] != $transaction['txn_id']) continue; ?>
<tr>
<td class="img">
<?php if (!empty($transaction_item['img']) && file_exists($transaction_item['img'])): ?>
<img src="<?=base_url?><?=$transaction_item['img']?>" width="50" height="50" alt="<?=$transaction_item['name']?>">
<?php endif; ?>
</td>
<td class="name"><?=$transaction_item['quantity']?> x <?=$transaction_item['name']?></td>
<td class="price"><?=currency_code?><?=number_format($transaction_item['price'] * $transaction_item['quantity'],2)?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tbody>';
foreach($order['items'] as $transaction_item){
$view .= '<tr>
<td class="img">';
if(!empty($transaction_item['full_path'])){
$view .= '<img src="'.img_url.''.$transaction_item['full_path'].'" width="50" height="50" alt="'.(${$transaction_item['item_name']} ?? $transaction_item['item_name']).'">';
}
$view .= '</td>
<td class="name">'.$transaction_item['item_quantity'].' x '.(${$transaction_item['item_name']} ?? $transaction_item['item_name']).'</td>
<td class="price">'.currency_code.''.number_format($transaction_item['item_price'] * $transaction_item['item_quantity'],2).'</td>
</tr>';
}
$view .= ' </tbody>
</table>
</div>
</div>
<?php endforeach; ?>
</div>';
}
</div>
<?php elseif ($tab == 'downloads'): ?>
<div class="mydownloads">
$view .= '
</div>';
}
<h2><?=$h2_mydownloads?></h2>
elseif($tab == 'settings'){
<?php if (empty($downloads)): ?>
<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; ?>
$view .= '<div class="settings">
</div>
<?php elseif ($tab == 'settings'): ?>
<div class="settings">
<h2><?=$h2_settings?></h2>
<h2>'.$h2_settings.'</h2>
<form action="" method="post">
<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>
<label for="email" class="form-label">'.$settings_email.'</label>
<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>
<input type="password" id="password" name="password" placeholder="<?=$settings_new_password?>" value="" autocomplete="new-password" class="form-field">
<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">
<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">
<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($identity['first_name'] ?? '', ENT_QUOTES).'" class="form-field">
<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">
<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($identity['last_name'] ?? '', ENT_QUOTES).'" class="form-field">
<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">
<label for="address_street" class="form-label">'.$shipping_address.'</label>
<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>
<input id="address_city" type="text" name="address_city" placeholder="<?=$shipping_city?>" value="<?=htmlspecialchars($account['address_city'], ENT_QUOTES)?>" class="form-field">
<label for="address_city" class="form-label">'.$shipping_city.'</label>
<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>
<input id="address_state" type="text" name="address_state" placeholder="<?=$shipping_state?>" value="<?=htmlspecialchars($account['address_state'], ENT_QUOTES)?>" class="form-field">
<label for="address_state" class="form-label">'.$shipping_state.'</label>
<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>
<input id="address_zip" type="text" name="address_zip" placeholder="<?=$shipping_zip?>" value="<?=htmlspecialchars($account['address_zip'], ENT_QUOTES)?>" class="form-field">
<label for="address_zip" class="form-label">'.$shipping_zip.'</label>
<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>
<input id="address_phone" type="text" name="address_phone" placeholder="<?=$shipping_phone?>" value="<?=htmlspecialchars($account['address_phone'], ENT_QUOTES)?>" class="form-field">
<label for="address_phone" class="form-label">'.$shipping_phone.'</label>
<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>
<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>
<?php endforeach; ?>
<label for="address_country" class="form-label">'.$shipping_country.'</label>
<select id="address_country" name="address_country" required class="form-field">';
foreach($countries as $country){
$view .= ' <option value="'.$country['id'].'" '.($country['id']==$identity['address_country'] ? ' selected' : '').'>'.(${$countryMap[$country['id']]} ?? $countryMap[$country['id']]).'</option>';
}
$view .= '
</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>
</div>
</div>';
}
<?php endif; ?>
}
$view .= '</div>';
<?php endif; ?>
//OUTPUT
echo $view;
</div>
<?=template_footer()?>
template_footer();

View File

@@ -194,14 +194,14 @@ $view .='<form id="product-form" action="" method="post">';
$output .= '
<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>
</label>';
} else {
$output .= '
<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>';
}
@@ -229,14 +229,14 @@ $view .='<form id="product-form" action="" method="post">';
$output .= '
<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>
</label>';
} else {
$output .= '
<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>';
}
@@ -267,12 +267,12 @@ $view .='<form id="product-form" action="" method="post">';
$IMG_small_id = img_url.$attribute['full_path']; //URL TO SMALL IMAGE
$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 {
$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>
//Read urlstring
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
if (option_id != \'\'){
if (option_id != url_slug){
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>';
}

View File

@@ -61,7 +61,7 @@ $view .=' <h2>'.$h1_content_top.'</h2>
if(show_offer_product_page){
$view .= '
<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>
';
}
@@ -140,7 +140,7 @@ $view .= '<div class="products-wrapper">';
$view .= '
<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">
<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>';
//CHECK IF CONFIGURATION SETTING IS FOUND AND NOT EMPTY => USE GROUP TO DISPLAY IMAGES

View File

@@ -16,13 +16,27 @@ searchInput.onkeyup = event => {
};
if (document.querySelector('.product-img-small')) {
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 => {
img.onmouseover = () => {
document.querySelector('.product-img-large img').src = img.src;
imgs.forEach(i => i.parentElement.classList.remove('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', `
<div class="img-modal">
<div>
@@ -39,13 +53,19 @@ if (document.querySelector('.product-img-small')) {
document.querySelector('.img-modal').onclick = event => {
if (event.target.classList.contains('img-modal')) document.querySelector('.img-modal').remove();
};
};*/
};
});
}
if (document.querySelector('.product #product-form')) {
let updatePrice = () => {
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 => {
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);
if (rrp !=0)
{
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());
updatePrice();

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

BIN
uploads/morval-crown.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

BIN
uploads/morval_box.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

BIN
uploads/morval_closure.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

View File

@@ -5,8 +5,8 @@ define('interface', true);
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
// Includes
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
include '/custom/settings/config.php';
include 'functions.php';
include './custom/settings/config.php';
include './functions.php';
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
//LOGIN TO API
@@ -76,7 +76,9 @@ try {
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
//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
$dompdf->loadHtml($data);

View File

@@ -1,8 +1,8 @@
<?php
// 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.php';
include './functions.php';
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
//LOGIN TO API
@@ -73,7 +73,9 @@ if($token !=''){
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
//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
$dompdf->loadHtml($data);