Inloggen
Als u een account bij ons heeft, meld u dan aan.
Registreren
Door een account aan te maken in deze winkel kunt u het betalingsproces sneller doorlopen, meerdere adressen opslaan, bestellingen bekijken en volgen en meer.
Account aanmaken
Spigen
Galaxy S21 Spigen Camera Lens Glass Protector - Zwart
€30,00
Deze Spigen Samsung Galaxy S21 Camera Lens Protector biedt een extra bumper om de cameralenzen.
Spigen
Galaxy S21 Spigen Neo Flex Solid Screenprotector - 2 Pack
€30,00
Bestel de Samsung Galaxy S21 Spigen Neo Flex Solid Screen Protector en houd uw beeldscherm zo goed als nieuw!
// ==UserScript==
// @name See comments in order overview kit 1.5
// @version 1.5
// @description Useful utilities for user information in the backoffice
// @changelog Only see comment or memo when there is one
// @author Lucien Versendaal @ Lightspeed HQ
// @run-at document-end
// @match https://*.webshopapp.com/admin/*
// ==/UserScript==
(function () {
// Promise request
function get(url) {
// Return a new promise.
return new Promise((resolve, reject) => {
// Do the usual XHR stuff
var req = new XMLHttpRequest();
req.open('GET', url);
req.onload = () => {
// This is called even on 404 etc
// so check the status
if (req.status == 200) {
// Resolve the promise with the response text
resolve(req.response);
} else {
// Otherwise reject with the status text
// which will hopefully be a meaningful error
reject(Error(req.statusText));
}
};
// Handle network errors
req.onerror = () => {
reject(Error("Network Error"));
};
// Make the request
req.send();
});
}
function userKit() {
if (/^\/admin\/orders\/?$/i.test(location.pathname)) {
const icons = {
comment: ''
}
get('/admin/orders.json' + location.search).then((response) => {
// console.log( JSON.parse(response).shop_users.findIndex((u) => {return u.id == 462023 }) );
// [...document.querySelectorAll('.table > table tbody tr')].forEach((u) => {
// console.log(u.dataset.id);
// });
JSON.parse(response).orders.forEach((u) => {
//console.log(Object.entries(u.comment).filter());
//console.log('Customer:: ' + u.customer.national_identification);
// Insert html
// document.querySelector('.table > table tbody tr[data-id="'+u.id+'"]').insertAdjacentHTML('afterend', '
'+ Object.entries(u.permissions).filter((p) => p[1] == "write" && p[0] != "any" ).map(p => icons[p[0]]).join("") +' |
');
var commentLength = u.comment.length;
var memoLength = u.memo.length;
//var customerNationalID = u.customer.national_identification;
//if(customerNationalID > 0)
//{
// document.querySelector('.table > table tbody tr[data-id="' + u.id + '"]').insertAdjacentHTML('afterend', '
BSN: ' + customerNationalID + ' |
');
//}
if (commentLength > 0 && memoLength > 0) {
//document.querySelector('.table > table tbody tr[data-id="' + u.id + '"]').insertAdjacentHTML('afterend', '
'+ (u.number) +' Klantopmerking: ' + (u.comment.trim()) + ' |
');
document.querySelector('.table > table tbody tr[data-id="' + u.id + '"]').insertAdjacentHTML('afterend', '
'+ (u.number) +' Interne notitie: ' + (u.memo.trim()) + ' |
');
// Trigger tooltip
//$('.TM_custom i.TM_custom_icon').tipsy({opacity: 1});
}else if(memoLength > 0){
document.querySelector('.table > table tbody tr[data-id="' + u.id + '"]').insertAdjacentHTML('afterend', '
'+ (u.number) +' Interne notitie: ' + (u.memo.trim()) + ' |
');
}else if(commentLength > 0){
//document.querySelector('.table > table tbody tr[data-id="' + u.id + '"]').insertAdjacentHTML('afterend', '
'+ (u.number) +' Klantopmerking: ' + (u.comment.trim()) + ' |
');
}
});
})
}
}
// Init
userKit();
// Init on page load (Turbolinks)
document.addEventListener("page:load", function () {
userKit();
});
})();