Styling and Layout of Guest/Account Selection Block

  • Posts: 597
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
8 hours 20 minutes ago #367681

-- HikaShop version -- : 5.1.2
-- Joomla version -- : 5.3.1
-- PHP version -- : 8.3

Hi HikaShop team,

We’d like to modify the design of the "Identification" block (where users choose between login, create an account, or checkout as guest), as shown in the attached screenshot.



Specifically, we want to:

Display the three options vertically aligned (one below the other),
Match the button styles with the rest of our site template (as used on the main login button on the right).

Could you please advise whether it’s best to:

Modify a specific view file (if so, which one exactly?),

Or apply a CSS override (and if so, is there a recommended way/place to do that for this block)?

Thank you in advance!

Kind regards,
Lumiga

In the configuration we use this setting:


Kind regards,
Lumiga
Attachments:
Last edit: 8 hours 16 minutes ago by Lumiga.

Please Log in or Create an account to join the conversation.

  • Posts: 597
  • Thank you received: 23
  • Hikaserial Subscription Hikashop Multisite
7 hours 29 minutes ago #367682

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


Kind regards,
Lumiga
Attachments:
Last edit: 7 hours 28 minutes ago by Lumiga.

Please Log in or Create an account to join the conversation.

  • Posts: 83997
  • Thank you received: 13611
  • MODERATOR
3 hours 31 minutes ago #367685

Hi,

Thank you for your feedback. We'll look at doing something for this with the next version of HikaShop.

Please Log in or Create an account to join the conversation.

Time to create page: 0.077 seconds
Powered by Kunena Forum