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

Hide Add to Cart button for Products with $0 price


Kristy

Question

Site URL: https://www.ffp.com.au

Hi I am wanting to hide the add to cart button for all products that have a $0 price. 
I have used javascript to change the price ($0) to display POA instead but I'm not sure what extra coding I need to add to hide the Add to Cart button on these items.

The javascript I am using is - 

<script>
  /* Brine: Change 0.00 prices to POA */
window.Squarespace.onInitialize(Y, function(){
  var products = document.querySelectorAll('.ProductItem, .ProductList-item'), i, len = products.length;
  for (i=0; i<len; i++) {
    var price = products.querySelector('.sqs-money-native');
    if (price.textContent === '0.00') {
      price.parentNode.textContent = 'POA';  
    }
  }
});
</script>

 

Any help is much appreciated.

Link to post
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Popular Posts

If you can add tag to all 0$ products, eg tag: zero you can add this code to Home > Design > Custom CSS to hide add to cart .tag-zero .sqs-add-to-cart-button-wrapper { display: none

1 answer to this question

Recommended Posts

Create an account or sign in to comment

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


×
×
  • Create New...