I want make the mega menu 2nd level child header clickable in Warehouse

Solved

I want make the mega menu 2nd level child header clickable in Warehouse

lesriches
Excursionist
30 0 10

Hi all,

I want make the mega menu 2nd level child header clickable in Warehouse i.e  i want make the Baby Clothes,Games & Toys, Accessories  clickable .
Store: https://lesriches.co.uk/

Can anyone help me .

Thanks 

lesriches_2-1728573002436.png

 

 

Accepted Solution (1)

theycallmemakka
Shopify Partner
1803 437 468

This is an accepted solution.

Hi @lesriches ,

 

It looks like all the header links on the navigation bar is changed to a h5 tag. This is why the links are not clickable. However, I have written custom JS to fix this. Please follow below steps and let me know if this works.

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file
4) Add the following code just above tag </body>

 

<script>
  document.addEventListener('DOMContentLoaded', function () {
    const style = document.createElement('style');
    style.innerHTML = `
      .nav-bar h5 a {
      font-family: Satoshi-Bold !important;
  }
    `;
    document.head.appendChild(style);
      document.querySelectorAll('.nav-bar .mega-menu__column h5').forEach(function(h5) {
        const anchor = document.createElement('a');
        
        const hrefValue = h5.getAttribute('href') || '#';
        anchor.href = hrefValue;
        
        anchor.textContent = h5.textContent;
      
        h5.textContent = '';  
        h5.appendChild(anchor);  
    });
  });
</script>

 

If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

 

Best Regards,
Makka

Support Me: Buy me a Coffee


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com

View solution in original post

Replies 2 (2)

theycallmemakka
Shopify Partner
1803 437 468

This is an accepted solution.

Hi @lesriches ,

 

It looks like all the header links on the navigation bar is changed to a h5 tag. This is why the links are not clickable. However, I have written custom JS to fix this. Please follow below steps and let me know if this works.

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file
4) Add the following code just above tag </body>

 

<script>
  document.addEventListener('DOMContentLoaded', function () {
    const style = document.createElement('style');
    style.innerHTML = `
      .nav-bar h5 a {
      font-family: Satoshi-Bold !important;
  }
    `;
    document.head.appendChild(style);
      document.querySelectorAll('.nav-bar .mega-menu__column h5').forEach(function(h5) {
        const anchor = document.createElement('a');
        
        const hrefValue = h5.getAttribute('href') || '#';
        anchor.href = hrefValue;
        
        anchor.textContent = h5.textContent;
      
        h5.textContent = '';  
        h5.appendChild(anchor);  
    });
  });
</script>

 

If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

 

Best Regards,
Makka

Support Me: Buy me a Coffee


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com

alis13
Tourist
4 0 1

Hello!
My site is at: https://toysstore.ca/
Thank you!