Jump to content

How can I hide the ecommerce cart when it is empty?

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Something simple like this should work:

.Cart[aria-label^='0'], .Cart:not([aria-label]) {
  display: none;
}

Let me know how that works for you. It's not something I heavily tested. If it does work, it could be modified using opacity and transitions instead.

Related:

Also, is it just me or is there no way to get to the checkout on mobile using the Foster template? Using the demo site, there was no link to the checkout at any point in my mock-shopping.

-Brandon

If a response helped you out, send a 'Like' 👍 (bottom-right) and/or 'Upvote' vote.jpg.c260784ece77aec852b0e3049c77a607.jpg (top-left)

Link to comment

Great use of the accessibility attribute 🙂

 

On 10/29/2019 at 1:01 PM, brandon said:

is it just me or is there no way to get to the checkout on mobile using the Foster template

It's an unfortunate setting for a Squarespace demo! They've set MOBILE: CART to Position: Hide in Site Styles.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
  • 1 month later...
  • 3 months later...
On 10/30/2019 at 12:01 AM, brandon said:

Something simple like this should work:


.Cart[aria-label^='0'], .Cart:not([aria-label]) {
  display: none;
}

Let me know how that works for you. It's not something I heavily tested. If it does work, it could be modified using opacity and transitions instead.

Related:

Also, is it just me or is there no way to get to the checkout on mobile using the Foster template? Using the demo site, there was no link to the checkout at any point in my mock-shopping.

-Brandon

@brandon Thank you so much for this super simple clean code! It works perfectly on Maple, Brine 🙂

Link to comment

Archived

This topic is now archived and is closed to further replies.

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