• Priority: 0
  • Status: Waiting on customer
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 18.03.25, 15:25
  • Opened by: Lorenzo Milano

Ticket #25995 - Extra tabs only visible to logged in users

Hello there, one question. Would be possible please to make the extra tab module content on the product page only visible to logged in users?

Comments

Fred 18 Mar 2025, 21:47

Hi, Lorenzo.
Add the following script to the Theme Settings → Customer JS

document.addEventListener('DOMContentLoaded', () => {
  document.body.classList.add(prestashop.customer.is_logged ? 'logged' : 'guest');
});

And CSS to Customer CSS

.guest [aria-controls="extra-1"], .guest #extra-1 {
    display: none
}
Lorenzo Milano 19 Mar 2025, 13:10

Thank you so much! One more thing, could be possible please when user is not logged in, to continue displaying the tab title and instead of content a quote like "register to access this content". Thank you in advance

Fred 19 Mar 2025, 22:10

That requires more time on development, at the moment we are busy with the theme update which should be ready for the Prestashop 9.0 release