Hi HikaShop team,
We’ve encountered a styling issue with the registration method selection block (login / create account / guest checkout).
By default, HikaShop renders these options as <label> elements linked to hidden radio buttons. Although we’ve added the correct classes (uk-button uk-button-primary) under "CSS for buttons" in the HikaShop configuration, these styles are not applied as expected — likely because UIkit does not style <label> elements in the same way as <button> or <a> elements.
To solve this, we replaced the <label> elements with real <button> elements using JavaScript. The script creates new buttons with the correct UIkit classes, and clicking them manually checks the corresponding radio input and calls displayRegistration() to trigger the registration logic.
document.addEventListener("DOMContentLoaded", function () {
// Radio-opties met bijbehorende knoptekst
const options = [
{
id: 'data_register_registration_methodlogin',
text: 'Inloggen'
},
{
id: 'data_register_registration_method0',
text: 'Account aanmaken'
},
{
id: 'data_register_registration_method2',
text: 'Bestellen als gast'
}
];
const container = document.querySelector('#data_register_registration_method div[data-toggle]');
if (!container) return;
// Maak het visuele blok leeg
container.innerHTML = '';
options.forEach(option => {
const button = document.createElement('button');
button.type = 'button';
button.className = 'uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom';
button.textContent = option.text;
button.addEventListener('click', () => {
const radio = document.getElementById(option.id);
if (radio) {
radio.checked = true;
// Trigger event die HikaShop gebruikt
if (typeof displayRegistration === 'function') {
displayRegistration(radio);
}
}
});
container.appendChild(button);
});
});
in combination with this CSS custom code:
/* Container for vertical layout and alignment */
#data_register_registration_method div[data-toggle] {
display: flex;
flex-direction: column;
align-items: stretch;
max-width: 300px;
margin-bottom: 40px;
}
/* Buttons: full width inside the container, with 20px margin on the right */
#data_register_registration_method label.btn {
width: calc(100% - 20px);
margin-right: 20px;
margin-bottom: 1rem;
box-sizing: border-box;
}
/* No extra margin under the last button */
#data_register_registration_method label.btn:last-child {
margin-bottom: 0;
}
This works perfectly and now matches our template styling, but it feels like a workaround.
Our question:
Would it be possible in a future update to render the login/registration/guest choices using <button> elements directly (instead of <label>) — or allow us to configure this behavior — so that styling is applied automatically via the standard button class setting?
Thanks in advance for your help!
Kind regards,
Lumiga