Jump to content

Include link to custom "store" page (not an actual Squarespace store page) in the Store categories side bar

Go to solution Solved by tuanphan,

Recommended Posts

Posted

Site URL: https://www.jrskybulb.com/store/canvas-prints

For my website, I am not using the root /store page as I wanted a custom page to introduce my store categories (/store-home). Then, all my products are in categories within the /store (for example /store/canvas-prints).

What I need now is a way to put a link in the categories sidebar allowing going back to the /store-home page instead of the hidden /store page I don't use. Any solution to do that? In the example below, it would be ideal for me to have a link to my /store-home page just above the "Canvas prints" category in the sidebar.

image.png.24e4e213c97d8e71da40093e6c6c3303.png

Hi! I'm JR Skybulb, a former physicist (one actually cannot stop being one...) and now recently a semi-professional photographer. Feel free to contact me and check out my Squarespace website here: https://www.jrskybulb.com.

  • Solution
Posted

You can use this code to Website Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
  $(document).ready(function(){
  $('<li class="category-item"><a href="/store-home" class="category-link">Store Home</a></li>').insertBefore('.nested-category-tree-wrapper>ul>li:first-child');
});
</script>

image.thumb.png.67c2430d496d6c43ead89a4643a082dc.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.