Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

7.1 change mobile store category to drop down?


rkeep

Question

Site URL: http://www.bighousecards.com

Trying to find a little code to change the 7.1 store mobile or both view to be a category dropdown vs. a scrolling list to the right or left.  The average person wouldn't know to scroll categories.  Took me a while to figure it out thinking my categories were not being displayed.  

Really appreciate any assistance as this is an annoying issue and I really don't want to change versions just for this. 

Thank you

Ryan

Screenshot_20200715-170147.png

Link to comment

25 answers to this question

Recommended Posts

  • 0
10 hours ago, rwp said:

I tested this on another 7.1 site, and have it figured out, I just need the password to test on yours and then I can share.

I am having the same problem (one member emailed me), can you share the code? Thank you.

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 0
19 hours ago, bbarinaga said:

Hello.

I'm having the same issue and would love to use a drop down for categories on mobile.

Can you help me with the code @tuanphan?

https://mistoa.squarespace.com/tienda

password: 1234

This is complex. @rwp has this code

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 0

Sorry I missed this.

If you are on 7.1, head to my webpage (link below).

Click the code pen link and the code is "Product Cat to Dropdown"

Follow the directions in my signature to set up the jquery scripts, and you can put the code in the shops page code injection. Let me know if it gives you any issues.

This isn't a turnkey solution usually, it takes some tweaking for each website. Special characters in the categories also need attention.

You will also need to use CSS to style the drop down, and locate it, as well as show/hide it, and the original menu, on desktop/mobile.

Edited by rwp
Link to comment
  • 0
On 8/4/2020 at 6:01 PM, rwp said:

Sorry I missed this.

If you are on 7.1, head to my webpage (link below).

Click the code pen link and the code is "Product Cat to Dropdown"

Follow the directions in my signature to set up the jquery scripts, and you can put the code in the shops page code injection. Let me know if it gives you any issues.

This isn't a turnkey solution usually, it takes some tweaking for each website. Special characters in the categories also need attention.

You will also need to use CSS to style the drop down, and locate it, as well as show/hide it, and the original menu, on desktop/mobile.

rwp,

First off, this is a MUST HAVE. The horizontal Cat scroll is a ux nightmare.

I tried exactly what you laid out. Tested on mobile. Unfortunately, no effect. 

- Added Jquery to global header
- Added your JS script to global header

To be clear, I am supposed to put the Jquery in the header code injection area, correct? And same with your script?

I made sure to add <script>and</script> tags

See attached screenshot to confirm.

Any further guidance would be very much appreciated.

007.png

Link to comment
  • 0

@birdmade Apparently squarespace uses a few different layouts for the categories.

This one is more complex, with the items and sub items. Head to my codepen and check out "Product Cat to Dropdown Alternate".

This will only work with the parent categories and will ignore the sub items. Drop me an email if you would like me to dig into this deeper.

Link to comment
  • 0

Sorry I think I missed out whatever code was shared here. I have the same theme and issue as the threadstarter. I have more than 6 categories, the last few get hidden with the horizontal scrolling. I have added categories links under menu as a solution but visitors have to click on the hamburger menu icon. Is there a better way to display categories for mobile view?  @rwp @tuanphan if you're able to help please. Thank you.

Link to comment
  • 0
On 11/26/2020 at 6:19 AM, Kkaarrllyy said:

Hi rwp

I would like to change this on my site too and have no idea how to do it, would you be able to help? 

https://www.purecandlesupplies.com.au/shop

Thanks

Karly

 

7 hours ago, xspxsp said:

Sorry I think I missed out whatever code was shared here. I have the same theme and issue as the threadstarter. I have more than 6 categories, the last few get hidden with the horizontal scrolling. I have added categories links under menu as a solution but visitors have to click on the hamburger menu icon. Is there a better way to display categories for mobile view?  @rwp @tuanphan if you're able to help please. Thank you.

Have you solved it yet?

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 0
On 8/4/2020 at 6:01 PM, rwp said:

Sorry I missed this.

If you are on 7.1, head to my webpage (link below).

Click the code pen link and the code is "Product Cat to Dropdown"

Follow the directions in my signature to set up the jquery scripts, and you can put the code in the shops page code injection. Let me know if it gives you any issues.

This isn't a turnkey solution usually, it takes some tweaking for each website. Special characters in the categories also need attention.

You will also need to use CSS to style the drop down, and locate it, as well as show/hide it, and the original menu, on desktop/mobile.

Hi, what's the website where we are to get this code? I don’t see the link below.

Link to comment
  • 0
On 1/8/2021 at 11:17 PM, sharine said:

Hi, what's the website where we are to get this code? I don’t see the link below.

He removed his signature. Not sure why ☘️

I access his code on jsfiddle, but it also says 404

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 0
On 11/25/2020 at 11:19 PM, Kkaarrllyy said:

I would like to change this on my site too and have no idea how to do it, would you be able to help? 

You can change the mobile product category slider into a centered list of categories by adding some CSS like this.

change-product-category-slide.gif.9ebb0ba5aace636ad3aabb1f2e580281.gif

I've posted the code here:

 

About Paul: Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Expert and founder of 
SF Digital, a company dedicated to improving websites by building the features Squarespace didn't include™. See our range of extensions to improve your online store.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Link to comment
  • 0
On 8/13/2021 at 2:01 AM, resonancemktg said:

Could someone please help me change the mobile store category to drop down as well? Happy to share URL and password privately.

Gratefully, Kelly

Hi. What is site url? We can help easier

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 0
On 1/20/2021 at 10:32 AM, paul2009 said:

You can change the mobile product category slider into a centered list of categories by adding some CSS like this.

change-product-category-slide.gif.9ebb0ba5aace636ad3aabb1f2e580281.gif

I've posted the code here:

 

Any chance someone can help me with this as well?  I am not very good with web stuff and definitely need the drop down option.

 

www.moonandstone.com

Link to comment
  • 0
On 5/20/2022 at 4:09 AM, moonandstone said:

Could someone help me as well??

Try adding to Settings > Advanced > Code Injection > Footer > Then check again on real mobile

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
    if(window.innerWidth <= 575 && $('.nested-category-children li a').length > 0) {
        let open = false
        $('<div id="t-category" name="t-category"><div id="t-control">Category <span id="t-down"></span><span id="t-up"></span></div><div id="t-menu"></div></div>').insertBefore('.nested-category-tree-wrapper');
        $('.nested-category-children li a').each(function(id, e) {
            const href = $(e).attr('href');
            const text = $(e).html();
            $('#t-menu').append('<a class="t-item" href="'+href+'">'+text+'</a>')
        })
        $('#t-control').click(function() {
            if (!open) {
            $('#t-menu').css('display', 'block')
            $('#t-down').css('display', 'none')    
            $('#t-up').css('display', 'unset')
            open = true
            } else {
                $('#t-menu').css('display', 'none')
            $('#t-down').css('display', 'unset')    
            $('#t-up').css('display', 'none')
            open=false
            }
        })
    }
})
</script>
<style>
#t-category {
    display: none;
}
@media only screen and (max-width: 575px) {
    .nested-category-children {
        display: none !important;
    }
    #t-menu {
        position: absolute;
    top: 35px;
    z-index: 1;
    background: white;

    display: none;
    right: 0;
    text-align: right;
    
    }
    #t-category {
        position: relative;
        display: inline-block;
        float: right;
        top: 5px;
        right: 0;
    }
    .nested-category-title {
        display: inline-block !important;
    }
    #t-control {
        font-family: baskerville-display-pt;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0em;
    text-transform: none;
    z-index: 12;

    font-size: 20px;
    position: absolute;
    top: 0;
    right: 0;
    padding-right: 20px;
    }
    .t-item {
        display: block;
        padding-left: 15px;
    }
    #t-down {
margin-left: 10px;
      position: absolute;
    top: 15px;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-top: 10px solid;
    right: 0;
    }
    #t-up {
       margin-left: 10px;
      position: absolute;
    bottom: 12px;
    right:0;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-bottom: 10px solid;
      display: none;
    }
}
</style>

 

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

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

×
×
  • Create New...