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

Change "You have nothing in your shopping cart" text

Question

Website is far from finished but having some trouble with this custom code

https://parakeet-radish-lrza.squarespace.com/cart

My aim is to change the "you have nothing in your shopping cart" text to read "Your collection is currently empty!"

My cart is acting as a collection for clients to view their selected talent, almost like a wishlist

The code below is working, but not every time, then if you refresh the page, it works again. Also if you have people in your cart/collection and then remove them, it again reads "you have nothing in your shopping cart"

Any ideas?


<script>
window.onload = function(){
  if (document.body.classList.contains('show-cart-page')) {
    var pageTitle = document.querySelector('.sqs-shopping-cart-wrapper');
    pageTitle.innerText = "Collection";
    pageTitle.style.opacity = 1; !important }
  if (document.body.classList.contains('has-cart')) {
      var pageDescription = document.querySelector('.empty-message');
      pageDescription.innerText = "Your collection is currently empty!"
      pageDescription.style.opacity = 1;
    }
 };
</script>


Edited by jackcavell
Initial Revision

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 1

@jackcavell You can use CSS to change text. Add to Home > Design > Custom CSS


.empty-message {
   visibility: hidden;
}
.empty-message:before {
   visibility: visible;
   content: "New Text Cart";
   font-size: 20px;
}

Reference: https://beaverhero.com/squarespace-all-css


Send me a message if you have any questions (free 10 minutes).

Don't send to forum message. I will check all questions via the link above

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