Jump to content

Cart missing from mobile view

Recommended Posts

Hi, our site is going live soon and we noticed that the cart icon and account login buttons are missing from the mobile view.  After inspecting both the mobile and web views I'm finding that the code is the same, but for some reason the mobile view is hiding the cart and login button.

Mangels Vineyards (squarespace.com)

I have attached two images showing the issue

Thanks for any help you all can provide.  DanielKeiran

MobileViewWithoutCartOrLogin.png

WebViewWithCartandLogin.png

Link to comment
  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

Well, the page was set up by another employee who used the default setting to add the cart.  So it shows up on the website just fine.  But when I switch to the mobile view it is not there.  So, the answer your question, we did not use custom code for the cart.  

When I view the code for the website and mobile view it appears the cart is in the code, but not visible in the mobile view.

Are there snippits out there that will add the cart to the mobile view or make it visible?

 

Link to comment

I see your Cart icon is Commerce7 cart icon, it is not SS cart icon, SS has no C7 cart icon by default, so I thought you added it with code

Can you check your site Code Injection Header & send this code? I will try tweaking it

image.thumb.png.da17687d26ca36bf72a051671a256bb6.png

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

<script type="text/javascript">
    document.addEventListener('DOMContentLoaded', function(event) {
    var node = document.createElement('div')
    var accountNode = document.createElement('div')
    accountNode.id = 'c7-account'
    node.appendChild(accountNode)
    
    var cartNode = document.createElement('div')
    cartNode.id = 'c7-cart'
    node.appendChild(cartNode)
    
    var header = document.getElementsByClassName('header-actions header-actions--right')[0]
    header.appendChild(node)
    })
</script>

 

Sorry, I talked to the guy who set up the website and he said he injected this.  If you can tweak it, that would be great!  Thank you.

Link to comment
On 9/26/2023 at 11:02 PM, DanielKeiran said:

<script type="text/javascript">
    document.addEventListener('DOMContentLoaded', function(event) {
    var node = document.createElement('div')
    var accountNode = document.createElement('div')
    accountNode.id = 'c7-account'
    node.appendChild(accountNode)
    
    var cartNode = document.createElement('div')
    cartNode.id = 'c7-cart'
    node.appendChild(cartNode)
    
    var header = document.getElementsByClassName('header-actions header-actions--right')[0]
    header.appendChild(node)
    })
</script>

 

Sorry, I talked to the guy who set up the website and he said he injected this.  If you can tweak it, that would be great!  Thank you.

Try changing this line

var header = document.getElementsByClassName('header-actions header-actions--right')[0]

to this

var header = querySelectorAll('header-actions header-actions--right')

(Remember to save a copy of all code somewhere, just for backup)

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

I tried that replacement, but then the cart and login button vanished on the webpage as well.  I put it back how it was.  

I do appreciate your assistance though.  Any other thoughts?  I'm flummoxed.  It's almost as though the cart is hiding on the mobile side somewhere.

Regards, Daniel

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...

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.