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

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

Question

4 answers to this question

Recommended Posts

  • 1

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

Edited by brandon

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

Share this post


Link to post
  • 0

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.

Edited by paul2009

sf-digital-signature-logo-email145.png.46606a2288a2847f44d81b9b7b58f3a5.png
Hi, I'm Paul, founder of SF Digital, a specialist company building the features that Squarespace didn't include.
Explore our range of Squarespace Extensions, including the Wishlist, Variant Availability and Datepicker Extension
Note that links in my posts may be affiliate links. Need personal help? 
Book a Squarespace Expert.

Share this post


Link to post
  • 0
Posted (edited)
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 🙂

Edited by Agnieszka

Share this post


Link to post

Create an account or sign in to comment

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


×
×
  • Create New...